<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>爱周末 &#187; date_default_timezone_set</title>
	<atom:link href="http://zhoumo123.cn/tag/date_default_timezone_set/feed" rel="self" type="application/rss+xml" />
	<link>http://zhoumo123.cn</link>
	<description>知识分享，共同进步。zhoumo123.cn</description>
	<lastBuildDate>Thu, 07 Nov 2019 05:53:49 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0.1</generator>
	<item>
		<title>PHP如何获取本地时间与服务器时间</title>
		<link>http://zhoumo123.cn/php/255.html</link>
		<comments>http://zhoumo123.cn/php/255.html#comments</comments>
		<pubDate>Tue, 19 Aug 2014 01:37:22 +0000</pubDate>
		<dc:creator><![CDATA[zhangc]]></dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[date_default_timezone_set]]></category>

		<guid isPermaLink="false">http://zhoumo123.cn/?p=255</guid>
		<description><![CDATA[获取时间现在几乎是每一个网站必须要用的方法，获取时间的方法有很多，比如用JS的new Date()方法，PHP的date(&#8220;Y-m-d h:i:s&#8221;);方法等等，但是这些都只是获取本地时间， 本地时间就是你电脑上面的时间，这样会经常出现用户时间不统一的事情。那么如何获取到服务器时间呢？今天我们来说一下。 PHP 获取时间： PHP 获取服务器时间： 上面的方法只是获取本地时间，加上下面一行代码，便能获取服务器时间。]]></description>
				<content:encoded><![CDATA[<p>获取时间现在几乎是每一个网站必须要用的方法，获取时间的方法有很多，比如用JS的new Date()方法，PHP的date(&#8220;Y-m-d h:i:s&#8221;);方法等等，但是这些都只是获取本地时间， 本地时间就是你电脑上面的时间，这样会经常出现用户时间不统一的事情。那么如何获取到服务器时间呢？今天我们来说一下。</p>
<p>PHP 获取时间：</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
    echo date(&quot;Y-m-d h:i:s&quot;);
?&gt;
</pre>
<p>PHP 获取服务器时间：</p>
<p>上面的方法只是获取本地时间，加上下面一行代码，便能获取服务器时间。</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
    date_default_timezone_set('PRC');
    echo date(&quot;Y-m-d h:i:s&quot;);
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://zhoumo123.cn/php/255.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
