<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-12168038.post982047360201949073..comments</id><updated>2009-08-20T05:41:31.978+05:30</updated><title type='text'>Comments on Vinod Singh: Date and TimeZone in Java</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.vinodsingh.com/feeds/982047360201949073/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12168038/982047360201949073/comments/default'/><link rel='alternate' type='text/html' href='http://blog.vinodsingh.com/2009/03/date-and-timezone-in-java.html'/><author><name>Vinod Singh</name><uri>http://www.blogger.com/profile/14429571106836951918</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-12168038.post-4735591632058341471</id><published>2009-08-20T05:41:31.978+05:30</published><updated>2009-08-20T05:41:31.978+05:30</updated><title type='text'>well if anyone's interested, i used jodatime. 3rd ...</title><content type='html'>well if anyone&amp;#39;s interested, i used jodatime. 3rd party java library. much accurate than java&amp;#39;s Date and Calendar classes. &lt;br /&gt;&lt;br /&gt;you can check it out&lt;br /&gt;http://tech.chitgoks.com/2009/07/06/convert-timezone-using-joda-time/</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12168038/982047360201949073/comments/default/4735591632058341471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12168038/982047360201949073/comments/default/4735591632058341471'/><link rel='alternate' type='text/html' href='http://blog.vinodsingh.com/2009/03/date-and-timezone-in-java.html?showComment=1250727091978#c4735591632058341471' title=''/><author><name>tech</name><uri>http://tech.chitgoks.com</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.vinodsingh.com/2009/03/date-and-timezone-in-java.html' ref='tag:blogger.com,1999:blog-12168038.post-982047360201949073' source='http://www.blogger.com/feeds/12168038/posts/default/982047360201949073' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-12168038.post-1023940575761864251</id><published>2009-08-20T05:04:56.301+05:30</published><updated>2009-08-20T05:04:56.301+05:30</updated><title type='text'>The issue with above code is you took output objec...</title><content type='html'>The issue with above code is you took output object from Calendar.getInstance(). That would give a instance in local timezone (e.g. IST in this case). Then date/time is set on this local calendar instance by several output.set(x,x) statements. When you print the date you see change in time and you assume that you successfully changed the timezone. Actually the &amp;#39;first&amp;#39; object is giving you the other time.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12168038/982047360201949073/comments/default/1023940575761864251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12168038/982047360201949073/comments/default/1023940575761864251'/><link rel='alternate' type='text/html' href='http://blog.vinodsingh.com/2009/03/date-and-timezone-in-java.html?showComment=1250724896301#c1023940575761864251' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.vinodsingh.com/2009/03/date-and-timezone-in-java.html' ref='tag:blogger.com,1999:blog-12168038.post-982047360201949073' source='http://www.blogger.com/feeds/12168038/posts/default/982047360201949073' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-12168038.post-4354593884753647960</id><published>2009-05-30T04:22:27.876+05:30</published><updated>2009-05-30T04:22:27.876+05:30</updated><title type='text'>You are mixing up the concepts of Calendar/Date/Ti...</title><content type='html'>You are mixing up the concepts of Calendar/Date/Timezone.  The reason Date.toString is always your local timezone is because your local machine's timezone is being used when formatting the output.  In your example:&lt;br /&gt;   IST: Sat Mar 07 22:38:16 IST 2009&lt;br /&gt;   GMT: Sat Mar 07 17:08:16 IST 2009&lt;br /&gt;are 2 different times and it is not a good idea to "overlook safely".&lt;br /&gt;&lt;br /&gt;In fact, the same Date object can be output to any timezone's time using DateFormat with timezone set. &lt;br /&gt;For example: with the same Date object, you can output to the following strings with DateFormat.&lt;br /&gt;&lt;br /&gt;May 29, 2009 10:40:18 PM GMT&lt;br /&gt;May 29, 2009 3:40:18 PM PDT&lt;br /&gt;May 30, 2009 4:10:18 AM IST</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12168038/982047360201949073/comments/default/4354593884753647960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12168038/982047360201949073/comments/default/4354593884753647960'/><link rel='alternate' type='text/html' href='http://blog.vinodsingh.com/2009/03/date-and-timezone-in-java.html?showComment=1243637547876#c4354593884753647960' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.vinodsingh.com/2009/03/date-and-timezone-in-java.html' ref='tag:blogger.com,1999:blog-12168038.post-982047360201949073' source='http://www.blogger.com/feeds/12168038/posts/default/982047360201949073' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-12168038.post-3759894318159796380</id><published>2009-05-13T13:05:00.000+05:30</published><updated>2009-05-13T13:05:00.000+05:30</updated><title type='text'>i created a calendar object with timezone America/...</title><content type='html'>i created a calendar object with timezone America/Los_Angeles dated dec 18, 2008 3:54pm. if changing it to Asia/Hong_Kong, result is not jan 1, 2009. any idea what could be wrong?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12168038/982047360201949073/comments/default/3759894318159796380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12168038/982047360201949073/comments/default/3759894318159796380'/><link rel='alternate' type='text/html' href='http://blog.vinodsingh.com/2009/03/date-and-timezone-in-java.html?showComment=1242200100000#c3759894318159796380' title=''/><author><name>chitgoks</name><uri>http://www.blogger.com/profile/04793105001370849590</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.vinodsingh.com/2009/03/date-and-timezone-in-java.html' ref='tag:blogger.com,1999:blog-12168038.post-982047360201949073' source='http://www.blogger.com/feeds/12168038/posts/default/982047360201949073' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-12168038.post-2254317507248365445</id><published>2009-05-10T23:51:00.000+05:30</published><updated>2009-05-10T23:51:00.000+05:30</updated><title type='text'>probably pst.getRawOffset() should be pst.getOffse...</title><content type='html'>probably pst.getRawOffset() should be pst.getOffset(date.getTime());</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12168038/982047360201949073/comments/default/2254317507248365445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12168038/982047360201949073/comments/default/2254317507248365445'/><link rel='alternate' type='text/html' href='http://blog.vinodsingh.com/2009/03/date-and-timezone-in-java.html?showComment=1241979660000#c2254317507248365445' title=''/><author><name>pik</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.vinodsingh.com/2009/03/date-and-timezone-in-java.html' ref='tag:blogger.com,1999:blog-12168038.post-982047360201949073' source='http://www.blogger.com/feeds/12168038/posts/default/982047360201949073' type='text/html'/></entry></feed>