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.
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.