The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::NTPTime - Retrieve NTP and UNIX timestamp (unsigned integer) from an NTP server.

SYNOPSIS

        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');

DESCRIPTION

Retrieves timestamps in NTP and UNIX formats from an NTP server.

METHODS

get_unix_time(OPTIONAL_NTP_SERVER)

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.

get_ntp_time(OPTIONAL_NTP_SERVER)

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.

The real credit goes to Tim Hogard for writing the code to do this. Thanks!

AUTHOR, COPYRIGHT, and LICENSE

Copyright(C) 2009, phatWares, USA. All rights reserved.

Permission is granted to use this software under the same terms as Perl itself. Refer to the Perl Artistic license for details.