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/ 

--



Other Threads

1. Announcement: [New project] Build and run only Dalvik

Hi Martin,

The purpose is to isolate Dalvik and its dependencies from rest of the
Android stack. It is for those times when you have a look at the entire
Android stack and have a thought like:

"Hmm. I would like to know only Dalvik code and its dependencies and am
really not interested in the entire stack right now".

The uses could be several. Some examples are:

- Porting onto another CPU architecture
- Using another toolchain for an existing architecture
- Removing bionic dependency
- Removing kernel android shared memory / binder dependency

Avtar




> website: 

2. Loading modules at boot-time.

How do I load certain modules at boot-time when there is no /etc/
modules.conf?
I apologize in advance for my inexperience, and I would greatly
appreciate some help.

Thanks, Jared

3. motorola backflip pics :)

4. Fwd: Dipilih dipilih....

5. Error "- exec '/system/bin/sh' failed: No such file or directory (2) -"

6. Nexus ONE info for iPhone users :)

7. dell 'streak'