in reply to 64 bit timestamp

Left of the "." is the number of seconds since Jan 1st, 1900 UTC.

Right of the "." is the number of 1/(2**32)th of seconds.

use Time::HiRes qw( time ); # Number of secs between 1900/01/01 UTC and 1970/01/01 UTC. my $ntp_epoch_diff = 2208988800; my $time = time(); my $ntp_ts = sprintf('%08X.%08X', int($time) + $ntp_epoch_diff, ($time - int($time)) * (2**32), );

(I don't know if the number of secs is correct.)

Replies are listed 'Best First'.
Re^2: 64 bit timestamp
by kaz219 (Initiate) on Nov 19, 2009 at 11:05 UTC
    Thank you very much! Just what I wanted =)