Strange timezone issue, when I set timezone to Alaska

by A.TNG » Fri, 23 Apr 2010 14:15:48 GMT


Sponsored Links
 Hi Guys,

I meet a strange timezone issue when I debug my application on
Android_2.1 SDK. I first start the emulator and set timezone to
"Alaska" in Settings. I also search the internet and find Alaska is in
GMT-9:00. If DST applied, it should be GMT-8:00. Then write some
sample code like:

TimeZone.getDefault().getOffset(0);  // returns 36000000 (= 10 * 60 * 60 * 1000)
TimeZone.getTimeZone("GMT-9:00").getOffset(0); // returns 32400000 (=
9 * 60 * 60 * 1000)

How does this happen? Why this same API getOffset with same parameter
returns different value?

Any idea? Thanks for your help. BTW: I'm not in Alaska now.

-- 
Best Regards,
TANG Jiyu
Blog:  http://jiyu.wordpress.com.cn/ 
ezkeypad:  http://ezkeypad.tool100.com/ 

--