Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


Php Programming Code Examples

Php > Code Snippets Code Examples

Atomic time

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Atomic time <?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; ?> This returns the time in the form of a timestamp