The missing hour
Yesterday I wrote a validation program for files with measurements. It reported 2012-03-25 02:00 as an invalid date given the date format yyyy-MM-dd HH:mm. Strange, what could be wrong?
Eventually I found it. This blows up:
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm"); df.setLenient(false); df.parse("2012-03-25 02:00");
However, change the time zone to UTC and it works:
Daylight savings (again). The specified hour does not exist with the default time zone (Europe/Stockholm).