Internet Time with PHP

Yes friends, we can determine Internet Time with PHP. Note that I am not talking about Server Time, so do not confuse it with the date() and time() functions. You know how you use automatic internet time to update the clock on your computer? That is what I am talking about. And we are going to determine it too...
If you are wondering when you would need this, let me put it simply and you can imagine the rest.
For example: you are working on an advanced project that involves, or will involve, fine-grained calculations, and for these not to go wrong you need to take every possibility into account (such as your server's clock being wrong or running behind) and, to avoid running into problems, you can perform the necessary checks by taking Internet Time as your reference.
Anyway, without dragging it out, let me give you the code, appreciate me ;)
<?php
error_reporting(E_ALL ^ E_NOTICE);
ini_set("display_errors", 1);
//date_default_timezone_set("Europe/Istanbul");
date_default_timezone_set("Europe/Moscow");//Normally We Should Use Istanbul, But Since Daylight Saving Time Was Abolished, We Made Sure The TimeZone Is GMT+03:00.
function ZamanSunucuQuery ($SunucuZamani, $Soket)
{
$BaglantiAc = fsockopen($SunucuZamani,$Soket,$HataKodu,$HataYazi,10);
# Parameters: SunucuZamani, Soket, HataKodu, HataYazi, Timeout
if($BaglantiAc)
{
fputs($BaglantiAc, "\n");
$ZamanDegeri = fread($BaglantiAc, 49);
fclose($BaglantiAc); # Close the Connection
}
else
{
$ZamanDegeri = " ";
}
$dizi = array();
$dizi[] = $ZamanDegeri;
$dizi[] = $HataKodu; # HataKodu
$dizi[] = $HataYazi; # HataYazi
return($dizi);
} # function ZamanSunucuQuery
$SunucuZamani = "time-nw.nist.gov"; //http://tf.nist.gov/tf-cgi/servers.cgi
$SorguSonucu = ZamanSunucuQuery($SunucuZamani, 37);
if(!$SorguSonucu[1])
{
$ZamanDegeri = bin2hex($SorguSonucu[0]);
$ZamanDegeri = abs(HexDec('7fffffff') - HexDec($ZamanDegeri) - HexDec('7fffffff'));
$ZamanDamgasi = $ZamanDegeri - 2208988800; # We convert it to Unix time
$UTC = date("Y-m-d (D) H:i:s",$ZamanDamgasi - date("Z",$ZamanDamgasi));
$YilGunu = (date("z",$ZamanDamgasi)+1);
echo "<b>",$SunucuZamani,"</b> Server Current Time :<br>\n [<font color=\"red\">",$ZamanDegeri,"</font>]";
echo " (seconds elapsed since 1900-01-01 00:00.00).<br>\n<br>\n";
echo "Current Date and Universal Time : ",$UTC," UTC. <br>\n<br>\n";
echo "Day ",$YilGunu," of the Year.<br>\n<br>\n";
echo "Unix Timestamp $ZamanDamgasi.<br>\n<br>\n";
$ZamanSonucu = date("H:i:s d-m-Y ", $ZamanDamgasi);
echo "<b><font color='green'>",$ZamanSonucu,"</font>";
}
else
{
echo "Sorry, the $SunucuZamani server could not be reached for the time check. ";
echo "$SorguSonucu[1] $SorguSonucu[2].<br>\n";
}
?>
Enjoy Using It. Take Care...