sniperscope Posted June 19, 2009 Share Posted June 19, 2009 Hi gurus, how can i get time stamp of time.windows.com ? i googled but not found something which i can use. Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted June 19, 2009 Share Posted June 19, 2009 You can always use other timeservers besides time.windows.com $timeserver = "time-C.timefreq.bldrdoc.gov"; function query_time_server ($timeserver, $port) { $timevalue = null; $fp = fsockopen($timeserver, $port, $err, $errstr, 5); if ($fp) { fputs($fp,"\n"); $timevalue = fread($fp,49); fclose($fp); } $ret = array( $timevalue, $err, // error code $errstr // error text ); return($ret); } // function query_time_server() $timercvd = query_time_server($timeserver,13); if (!$timercvd[1]) { $timevalue = $timercvd[0]; echo 'Time check from time server ',$timeserver,' : [<font color="red">',$timevalue,'</font>]'; } else { echo 'Unfortunately, the time server $timeserver could not be reached at this time. '; echo $timercvd[1].' '.$timercvd[2]; } Quote Link to comment Share on other sites More sharing options...
sniperscope Posted June 19, 2009 Author Share Posted June 19, 2009 Wow, Amazing. Thank you very very much for your help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.