Quick Search:
 
 PHP Code: Get Atomic time Jump to:  
Category: >> PHP Code >> Get Atomic time  

<< lastnext >>

Snippet Name: Get Atomic time

Description: This returns the time in the form of a timestamp.

Comment: (none)

Language: PHP
Highlight Mode: PHP
Last Modified: March 01st, 2009

<?PHP 
 
$fp = FSOCKOPEN("time-a.nist.gov", 37); 
IF ($fp) { 
FPUTS($fp, "\n"); 
$timevalue = FREAD($fp, 49); 
FCLOSE($fp); 
} 
 
$atomic_time = (ABS(HEXDEC('7fffffff') - HEXDEC(BIN2HEX($timevalue)) - HEXDEC('7fffffff')) - 2208988800); 
ECHO $atomic_time; 
 
?>
 


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org