in reply to NIST Atomic Clock Time

Uncorrected universal time (ie., time in Greenwich) is returned. Has the Javascript changed? Anyway, a local time correction (e.g., subtract 8 hours for US Pacific) is needed. P. Laub 21-Nov-2000

Replies are listed 'Best First'.
Re: Re: NIST Atomic Clock Time
by Anonymous Monk on Jan 29, 2001 at 23:15 UTC
    A small mod to you code will make it work on eastern time
    if ( $res->content =~ /NISTSendTime = new Date\(\s*\"(.*?)"\);/ ) { print "NIST Date/Time: $1<br>\n"; @words=split(" ",$1); print "GMT ".$words[3]."<br>"; @time=split(":",$words[3]); $gmt=$words[3]; $temp=$gmt-5; if ($temp < 0) {$temp=24-5}; $local=$temp.":".$time[1].":".$time[2]; print "LOCAL ".$local."<br>"; }