On Fri, Apr 23, 2010 at 6:53 PM, String <[email protected]> wrote: > On Apr 23, 11:10 am, "A.TNG" <[email protected]> wrote: > >> Since Alaska is in GMT-9:00, even doesn't include DST, getOffset(0) >> should return 32400000 (= 9*60*60*1000), right? I cannot understand >> why it returns 36000000 (=10*60*60*1000). If "36000000" is correct, >> that means Alaska is in GMT-10:00. > > Well, for starters, it looks like you're using getOffset() wrong. From > the docs (http://developer.android.com/reference/java/util/ > TimeZone.html#getOffset(long)), the parameter is "the date in > milliseconds since January 1, 1970 00:00:00 GMT". So unless you WANT > the TZ offset as of Jan 1, 1970, you shouldn't be passing it a zero. > Try passing it the current timestamp and see what you get. > > As for why it's giving you GMT-10? <shrug /> Perhaps Alaska's time > zone was GMT-10 in 1970. That's not inconsistent with the state's > latitude; the western Aleutians use GMT-10 in the winter, as does > Hawaii year-round. > > String >
Yes. In my case, I need to get TZ offset as of Jan 1, 1970. And sometime we pass a minus number to getOffset(), like -3600000. I'm not sure Alaska timezone will be GMT-10 in 1970. Thanks for your information. I will search more to find the result. Thank you very much. -- Best Regards, TANG Jiyu Blog: http://jiyu.wordpress.com.cn/ ezkeypad: http://ezkeypad.tool100.com/ -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

