<?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; UTC</title>
	<atom:link href="http://blog.myhnet.cn/tag/utc/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.myhnet.cn</link>
	<description>秋湍泻石髓 风叶聚云根</description>
	<lastBuildDate>Fri, 20 Aug 2010 15:05:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>tomcat时区设置问题</title>
		<link>http://blog.myhnet.cn/2009/06/04/the-problem-of-tomcat-timezone/</link>
		<comments>http://blog.myhnet.cn/2009/06/04/the-problem-of-tomcat-timezone/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 12:28:06 +0000</pubDate>
		<dc:creator>myhnet</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[BIOS时间]]></category>
		<category><![CDATA[BST]]></category>
		<category><![CDATA[硬件时间]]></category>
		<category><![CDATA[Europe/London]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[UTC]]></category>
		<category><![CDATA[时区设置]]></category>

		<guid isPermaLink="false">http://blog.myhnet.cn/?p=822</guid>
		<description><![CDATA[最近碰到一个很奇怪的问题，两台一模一样的机器，一样的时间，一样的时区，一样的tomcat，一样的代码。但是tomcat在两台机器上获取到的时间就是不一样，不仅不一样，其中一个的tomcat时间跟系统时间还不一致。 最开始试着通过修改catalina.sh把两个tomcat的时区都改为GMT，结果得到的时间还是不一样： JAVA_OPTS=&#34;-mx1600M -Duser.timezone=GMT&#34; 后来把tomcat的时区改为： JAVA_OPTS=&#34;-mx1600M -Duser.timezone=Europe/London&#34; 突然发现这个时候这台tomcat时间与系统时间一向不一致的机器，这个时候tomcat时间突然跟系统时间一致了，而另一台一直直一致的现在却不一致了(系统用的时区是BST，开始改GMT时区时没看出来)。 这个时候我才突然想到，tomcat读取的可能是硬件时间（BIOS时间），而这两台机器很有可能一台设置了使用UTC时间一台设置了不使用UTC时间。遂查看配置文件/etc/sysconfig/clock，果然如此。 修改成一致的设置，重启，果然正常了。]]></description>
			<content:encoded><![CDATA[<p>最近碰到一个很奇怪的问题，两台一模一样的机器，一样的时间，一样的时区，一样的tomcat，一样的代码。但是tomcat在两台机器上获取到的时间就是不一样，不仅不一样，其中一个的tomcat时间跟系统时间还不一致。</p>
<p>最开始试着通过修改<em>catalina.sh</em>把两个tomcat的时区都改为GMT，结果得到的时间还是不一样：</p>
<div class="hl-surround"><div class="hl-main">JAVA_OPTS=&quot;-mx1600M -Duser.timezone=GMT&quot;</div></div>
<p>后来把tomcat的时区改为：</p>
<div class="hl-surround"><div class="hl-main">JAVA_OPTS=&quot;-mx1600M -Duser.timezone=Europe/London&quot;</div></div>
<p>突然发现这个时候这台tomcat时间与系统时间一向不一致的机器，这个时候tomcat时间突然跟系统时间一致了，而另一台一直直一致的现在却不一致了(系统用的时区是BST，开始改GMT时区时没看出来)。</p>
<p>这个时候我才突然想到，tomcat读取的可能是硬件时间（BIOS时间），而这两台机器很有可能一台设置了使用UTC时间一台设置了不使用UTC时间。遂查看配置文件<em>/etc/sysconfig/clock</em>，果然如此。</p>
<p>修改成一致的设置，重启，果然正常了。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.myhnet.cn/2009/06/04/the-problem-of-tomcat-timezone/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ubuntu系统时间设置问题</title>
		<link>http://blog.myhnet.cn/2007/11/13/problem-on-ubuntu-time-setting/</link>
		<comments>http://blog.myhnet.cn/2007/11/13/problem-on-ubuntu-time-setting/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 00:47:00 +0000</pubDate>
		<dc:creator>myhnet</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[系统时间与硬件时间不一至]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[UTC]]></category>
		<category><![CDATA[UTC设置]]></category>
		<category><![CDATA[windows时间与linux时间不一致]]></category>
		<category><![CDATA[时间设置]]></category>

		<guid isPermaLink="false">http://blog.myhnet.cn/?p=92</guid>
		<description><![CDATA[忘了当初装系统的时间是怎么选择时间设置的了，反正现在ubuntu的时间比较怪，用hwclock &#8211;show查看，总是比实际时间快了八个小时，这样的话，总是导致在ubuntu与windows之间切换时很是头痛，时间跳来跳去，得不到统一。 后来实在没办法，用hwclock &#8211;local &#8211;hctosys 给ubuntu读入时间，然后，再次/etc/default/rcS里面的那一行UTC=yes改为了UTC=no，这下子重启总算没事了。 估计原因可能是当初在装系统时，将硬件（BIOS）时间设成了UTC时间，而那万恶的windows却没有这个功能，这才导至时间老是跳来跳去，将/etc/default/rcS时间的那一行改了，就是让系统把硬件（BIOS）时间当成本地时间 。 如果是RedHat系列，那么就要修改这个文件：/etc/sysconfig/clock。把其中的UTC=true改为UTC=false 关于如何修改ubuntu的时间，可以参看我的一篇译文： 如何Linux下修改系统时间]]></description>
			<content:encoded><![CDATA[<p>忘了当初装系统的时间是怎么选择时间设置的了，反正现在ubuntu的时间比较怪，用hwclock &#8211;show查看，总是比实际时间快了八个小时，这样的话，总是导致在ubuntu与windows之间切换时很是头痛，时间跳来跳去，得不到统一。</p>
<p>后来实在没办法，用hwclock &#8211;local &#8211;hctosys 给ubuntu读入时间，然后，再次/etc/default/rcS里面的那一行UTC=yes改为了UTC=no，这下子重启总算没事了。</p>
<p>估计原因可能是当初在装系统时，将硬件（BIOS）时间设成了UTC时间，而那万恶的windows却没有这个功能，这才导至时间老是跳来跳去，将/etc/default/rcS时间的那一行改了，就是让系统把硬件（BIOS）时间当成本地时间 。</p>
<p>如果是RedHat系列，那么就要修改这个文件：/etc/sysconfig/clock。把其中的UTC=true改为UTC=false</p>
<p>关于如何修改ubuntu的时间，可以参看我的一篇译文：<br />
<a href="http://blog.myhnet.cn/2008/12/30/how-to-set-the-date-on-your-linux-machine/">如何Linux下修改系统时间</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.myhnet.cn/2007/11/13/problem-on-ubuntu-time-setting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
