<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[php如何获得客户端时区，我想根据不同客户端的时区把时间戳显示为当地的时间？php如何获得客户端时区和时间，我想根据不同客户端的时区把时间戳显示为当地的时间？]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Wed, 04 Mar 2009 03:43:41 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	用js判断客户端的时区，然后写入cookie，然后php里根据cookie的时区来输出对应时间<br/>为什么用js？因为只有js才能获得客户端的时间，主要就是获取时间，然后进行时区判断<br/>var d = new Date();<br/>var tos = 0 - d.getTimezoneOffset() * 60;<br/>和格林威治时间的秒差<br/><br/><br/><br/>可以用JS取得客户端时间.&nbsp;&nbsp;&nbsp;&nbsp;将JS放在PHP程序里面就可以了. 如下：<br/>&lt;form&gt;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&lt;div&nbsp;&nbsp; ID=serverTime&gt; &lt;/div&gt;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&lt;div&nbsp;&nbsp; ID=localTime&gt; &lt;/div&gt;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&lt;/form&gt;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&lt;script&gt;&nbsp;&nbsp;<br/>&nbsp;&nbsp;var&nbsp;&nbsp; serverTime&nbsp;&nbsp; =&nbsp;&nbsp; &#039;&lt;?php&nbsp;&nbsp; print&nbsp;&nbsp; date(&quot;Y-m-d&nbsp;&nbsp; G:i:s&quot;);?&gt;&#039;;&nbsp;&nbsp;<br/>&nbsp;&nbsp;var&nbsp;&nbsp; d&nbsp;&nbsp; =&nbsp;&nbsp; new&nbsp;&nbsp; Date();&nbsp;&nbsp;<br/>&nbsp;&nbsp;var&nbsp;&nbsp; localTime&nbsp;&nbsp; =&nbsp;&nbsp; d.getYear()&nbsp;&nbsp; +&nbsp;&nbsp; &#039;-&#039;&nbsp;&nbsp; +&nbsp;&nbsp; (d.getMonth()&nbsp;&nbsp; +&nbsp;&nbsp; 1)&nbsp;&nbsp; +&nbsp;&nbsp; &#039;-&#039;&nbsp;&nbsp; +&nbsp;&nbsp; d.getDate()&nbsp;&nbsp; +&nbsp;&nbsp; &#039;&nbsp;&nbsp; &#039;&nbsp;&nbsp; +&nbsp;&nbsp; d.getHours()&nbsp;&nbsp; +&nbsp;&nbsp; &#039;:&#039;&nbsp;&nbsp; +&nbsp;&nbsp; d.getMinutes()&nbsp;&nbsp; +&nbsp;&nbsp; &#039;:&#039;&nbsp;&nbsp; +&nbsp;&nbsp; d.getSeconds();&nbsp;&nbsp;<br/>&nbsp;&nbsp;document.all[&#039;localTime&#039;].innerText&nbsp;&nbsp; =&nbsp;&nbsp; &#039;LOCALTIME:&#039;&nbsp;&nbsp; +&nbsp;&nbsp; localTime;&nbsp;&nbsp;<br/>&nbsp;&nbsp;document.all[&#039;serverTime&#039;].innerText&nbsp;&nbsp; =&nbsp;&nbsp; &#039;SERVERTIME:&#039;&nbsp;&nbsp; +&nbsp;&nbsp; serverTime;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&lt;/script&gt;<br/><br/>或者：<br/><br/>&nbsp;&nbsp;&lt;script&gt;&nbsp;&nbsp;<br/>&nbsp;&nbsp;var&nbsp;&nbsp; now&nbsp;&nbsp; =&nbsp;&nbsp; new&nbsp;&nbsp; Date();&nbsp;&nbsp;<br/>&nbsp;&nbsp;alert(now.getYear()+&quot;-&quot;+(now.getMonth+1)+&quot;-&quot;+now.getDate()+&quot;&nbsp;&nbsp; &quot;+now.getHours()+&quot;:&quot;+now.getMinutes()+&quot;:&quot;+now.getSeconds());&nbsp;&nbsp;<br/>&nbsp;&nbsp;&lt;/script&gt;<br/>
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] php如何获得客户端时区，我想根据不同客户端的时区把时间戳显示为当地的时间？php如何获得客户端时区和时间，我想根据不同客户端的时区把时间戳显示为当地的时间？]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>