<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Date puzzle</title>
	<atom:link href="http://blog.krecan.net/2008/11/26/date-puzzle/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.krecan.net/2008/11/26/date-puzzle/</link>
	<description>Short remarks from Java world</description>
	<lastBuildDate>Thu, 05 Aug 2010 19:56:41 +0200</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Antony Stubbs</title>
		<link>http://blog.krecan.net/2008/11/26/date-puzzle/comment-page-1/#comment-871</link>
		<dc:creator>Antony Stubbs</dc:creator>
		<pubDate>Sat, 21 Feb 2009 05:07:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=171#comment-871</guid>
		<description>Seriously. two words:
Joda Time

http://joda-time.sourceforge.net/</description>
		<content:encoded><![CDATA[<p>Seriously. two words:<br />
Joda Time</p>
<p><a href="http://joda-time.sourceforge.net/" rel="nofollow">http://joda-time.sourceforge.net/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Birkof</title>
		<link>http://blog.krecan.net/2008/11/26/date-puzzle/comment-page-1/#comment-677</link>
		<dc:creator>Birkof</dc:creator>
		<pubDate>Tue, 02 Dec 2008 16:00:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=171#comment-677</guid>
		<description>Output of your code on my PC is following:
Thu Jan 01 00:00:00 GMT 1970
0

So it will not print -3600000 everywhere on the planet, as you wrote. Used Java 1.5.0_04.

Yes, it depends on Timezone. But that&#039;s correct, not surprising behaviour. It is because you are asking what is different between already set timezone and GMT timezone.

For example, when you add these lines:
        TimeZone tz = TimeZone.getTimeZone(&quot;GMT+0:00&quot;);
        calendar.setTimeZone(tz);

the result must be on every PC 0.
 
When you add different number, then it depends on the difference between particular timezone and GMT. 

Anyway, these &quot;Calendar+Timezone&quot; classes/API is so complicated. It is because there are influed by historical and political reasons. So they are very different from the rest of any APIs, where logic works.</description>
		<content:encoded><![CDATA[<p>Output of your code on my PC is following:<br />
Thu Jan 01 00:00:00 GMT 1970<br />
0</p>
<p>So it will not print -3600000 everywhere on the planet, as you wrote. Used Java 1.5.0_04.</p>
<p>Yes, it depends on Timezone. But that's correct, not surprising behaviour. It is because you are asking what is different between already set timezone and GMT timezone.</p>
<p>For example, when you add these lines:<br />
        TimeZone tz = TimeZone.getTimeZone("GMT+0:00");<br />
        calendar.setTimeZone(tz);</p>
<p>the result must be on every PC 0.</p>
<p>When you add different number, then it depends on the difference between particular timezone and GMT. </p>
<p>Anyway, these "Calendar+Timezone" classes/API is so complicated. It is because there are influed by historical and political reasons. So they are very different from the rest of any APIs, where logic works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukáš Křečan</title>
		<link>http://blog.krecan.net/2008/11/26/date-puzzle/comment-page-1/#comment-673</link>
		<dc:creator>Lukáš Křečan</dc:creator>
		<pubDate>Thu, 27 Nov 2008 19:15:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=171#comment-673</guid>
		<description>Indeed, the one hour difference points to timezones, daylight savings or something similar. It is tempting to rule out the daylight saving, January is usually in the winter and daylight savings are applied in the summer. The correct answer is quite surprising. The GMT from JavaDoc is not the same as the GMT used in Date, Calendar and TimeZone. The GMT from JavaDoc refers to standard time (UTC). The GMT from Date class refers to London time (British Standard Time). And as you certainly know, between years 1968 and 1972 those crazy Brits kept summer time even over the winter. Thanks to them, we have quite confusing behaviour in our Java classes. Lets hope it will get better with the &lt;a href=&quot;http://today.java.net/pub/a/today/2008/09/18/jsr-310-new-java-date-time-api.html&quot; rel=&quot;nofollow&quot;&gt;new DateTime Java library&lt;/a&gt;. For more information you can read following &lt;a href=&quot;http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4832236&quot; rel=&quot;nofollow&quot;&gt;bug report&lt;/a&gt; and nice &lt;a href=&quot;http://www.srcf.ucam.org/~jsm28/british-time/&quot; rel=&quot;nofollow&quot;&gt;article about British time&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Indeed, the one hour difference points to timezones, daylight savings or something similar. It is tempting to rule out the daylight saving, January is usually in the winter and daylight savings are applied in the summer. The correct answer is quite surprising. The GMT from JavaDoc is not the same as the GMT used in Date, Calendar and TimeZone. The GMT from JavaDoc refers to standard time (UTC). The GMT from Date class refers to London time (British Standard Time). And as you certainly know, between years 1968 and 1972 those crazy Brits kept summer time even over the winter. Thanks to them, we have quite confusing behaviour in our Java classes. Lets hope it will get better with the <a href="http://today.java.net/pub/a/today/2008/09/18/jsr-310-new-java-date-time-api.html" rel="nofollow">new DateTime Java library</a>. For more information you can read following <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4832236" rel="nofollow">bug report</a> and nice <a href="http://www.srcf.ucam.org/~jsm28/british-time/" rel="nofollow">article about British time</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lasica</title>
		<link>http://blog.krecan.net/2008/11/26/date-puzzle/comment-page-1/#comment-672</link>
		<dc:creator>Lasica</dc:creator>
		<pubDate>Thu, 27 Nov 2008 17:12:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=171#comment-672</guid>
		<description>Just guess: Daylight saving time offset?</description>
		<content:encoded><![CDATA[<p>Just guess: Daylight saving time offset?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukáš Křečan</title>
		<link>http://blog.krecan.net/2008/11/26/date-puzzle/comment-page-1/#comment-671</link>
		<dc:creator>Lukáš Křečan</dc:creator>
		<pubDate>Thu, 27 Nov 2008 09:02:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=171#comment-671</guid>
		<description>Yes, -3600000 is printed. But it is printed even here in Dublin and I hope that  we would get the same result everywhere on the planet. So I am afraid it has nothing to do with Czech Republic.</description>
		<content:encoded><![CDATA[<p>Yes, -3600000 is printed. But it is printed even here in Dublin and I hope that  we would get the same result everywhere on the planet. So I am afraid it has nothing to do with Czech Republic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PB</title>
		<link>http://blog.krecan.net/2008/11/26/date-puzzle/comment-page-1/#comment-670</link>
		<dc:creator>PB</dc:creator>
		<pubDate>Wed, 26 Nov 2008 23:08:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=171#comment-670</guid>
		<description>Calendar and Date are timezone-senzitive, aren&#039;t they? So key is in &quot;GMT&quot; :-) If ran in Czech Republic, value of 3600000 will be printed ... at least I think.</description>
		<content:encoded><![CDATA[<p>Calendar and Date are timezone-senzitive, aren't they? So key is in "GMT" <img src='http://blog.krecan.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  If ran in Czech Republic, value of 3600000 will be printed ... at least I think.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
