For example, SimpleTimeZone() says
This code is simply wrong, since Congress changed the dates when the standard/daylight changes. I've seen other examples, altho I can't find them right now.
I know that Linux systems (and I assume OS-X and Windows as well) have specific operating system-wide files to control things like time zone names, standard/daylight changes, etc. that are periodically updated. Sometimes there are updated monthly or more frequently, as lawmakers in countries all over the world love to play with things.
Seems silly to me to have a language's runtime have its own system, or worse, expect programmers to remember what the rules are.
Does the JVM use the real system definition?
Christophe Verré wrote: Doesn't TimeZone takes care of getting the right values for you ?
That is my question, does the JVM do it right?
And the related question is: how often is the JVM updated to reflect silly politicians changing time. For examples:
Australia postponed its DST start in 2006 because of a sports event...
As of 2007 for example the USA will greatly expand the duration of DST (due to some Energy Conservation Act or something).
Pat Farrell wrote:That is my question, does the JVM do it right?
As far as I know, yes, it does it correctly, it gets information about daylight savings etc. from a config file that's hidden somewhere in the JRE. (I don't know which file, maybe it's somewhere inside rt.jar).
Pat Farrell wrote:And the related question is: how often is the JVM updated to reflect silly politicians changing time.
There are usually a few JDK / JRE updates a year and updated timezone / daylight savings information is almost always mentioned in the release notes. If you don't want to update your JDK or JRE you can use the timezone updater tool that Christophe mentioned.