Net::NTPTime
use Net::NTPTime; my $unix_time = get_unix_time; my $unix_time = get_unix_time('ntp.server.com'); my $ntp_time = get_ntp_time; my $ntp_time = get_ntp_time('ntp.server.com');
Retrieve NTP and UNIX timestamp (unsigned integer) from an NTP server.
Pollutes the namespace with two functions: get_unix_time & get_ntp_time
Returns an integer timestamp indicating the number of elapsed seconds since 00:00 01-JAN-1970. You may include a specific NTP server to ping, or a default server will be used.
Returns an integer timestamp indicating the number of elapsed seconds since 00:00 01-JAN-1900. You may include a specific NTP server to ping, or a default server will be used.
1.00 - Initial Release
1.01 - Bug fix (changed "require Socket" to "use Socket")
1.02 - Fixed this POD document
1.03 - More documentation fixes
Brandon Bourret
Permission is granted to use this software under the same terms as Perl itself.
Refer to the Perl Artistic license for details.
The real credit goes to Tim Hogard for writing the code to do this. Thanks!
To install Net::NTPTime, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::NTPTime
CPAN shell
perl -MCPAN -e shell install Net::NTPTime
For more information on module installation, please visit the detailed CPAN module installation guide.