Strange behavior with Timezone

java, timezone

Solution

That is ETC style :

http://en.wikipedia.org/wiki/Zoneinfo

The special area of "Etc" is used for some administrative zones, particularly for "Etc/UTC" which represents Coordinated Universal Time. In order to conform with the POSIX style, those zone names beginning with "Etc/GMT" have their sign reversed from what most people expect. In this style, zones west of GMT have a positive sign and those east have a negative sign in their name (e.g "Etc/GMT-14" is 14 hours ahead/east of GMT.)

Problem

I run the following Java code : ``` TimeZone tz1 = TimeZone.getTimeZone("Etc/GMT-3"); System.out.println(tz1.getDisplayName()); ``` The display is `GMT+03:00` ! It seems that when we use timezones with ids such as `Etc/GMTxx`, the sign is reversed. Why ?

Original source