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. Link to comment https://forums.phpfreaks.com/topic/162890-solved-timewindowscom/ 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]; } Link to comment https://forums.phpfreaks.com/topic/162890-solved-timewindowscom/#findComment-859488 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 Link to comment https://forums.phpfreaks.com/topic/162890-solved-timewindowscom/#findComment-859497 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.