<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; HTA: определение времени по Гринвичу]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=1030&amp;type=atom" />
	<updated>2008-01-10T19:09:42Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=1030</id>
		<entry>
			<title type="html"><![CDATA[HTA: определение времени по Гринвичу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=7800#p7800" />
			<content type="html"><![CDATA[<p>Пример показывает возможность получить точное время по Гринвичу из Интернет.<br /></p><div class="codebox"><pre><code>&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1251&quot; /&gt;
&lt;title&gt;Время по гринвичу&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;script language=&quot;javascript&quot;&gt;&lt;!--

var pageUrl = &quot;http://ntp.greenwichmeantime.com/time/scripts/clock-7/x.php&quot;;

window.attachEvent(&quot;onload&quot;,writeTime);

function SetTime(newtime){
        var d, s;
        d = new Date();
        d.setTime(newtime);
        s = &quot;Время по Гринвичу: &quot;;
        s += d.toUTCString();
        return(s);
}

function readTime(){
        var sUrlRequest = pageUrl;
        var oXMLHTTP = new ActiveXObject(&quot;MSXML2.XMLHTTP&quot;);
        oXMLHTTP.Open(&quot;get&quot;,sUrlRequest,false);
        oXMLHTTP.Send();
        return(SetTime(oXMLHTTP.Responsetext));
}

function writeTime(){
        document.getElementById(&quot;area&quot;).innerHTML = readTime();
        document.getElementById(&quot;area&quot;).style.display = &quot;block&quot;;
}
--&gt;
&lt;/script&gt;

&lt;div id=&quot;area&quot; style=&quot;display:none&quot;&gt;&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;</code></pre></div><p>Автор примера - <strong>Санёк</strong>.</p>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2008-01-10T19:09:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=7800#p7800</id>
		</entry>
</feed>
