Jump to content

[SOLVED] time.windows.com


sniperscope

Recommended Posts

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];
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.