[Advanced-java] Bug in the SimpleDateFormat

phoenix@vt4.net phoenix at vt4.net
Mon Mar 24 11:15:26 2003


Hello everybody 
I have discovered a small bug in 
the DateFormat-class

I use the SimpleDateFormat-class to parse a String ("30-03-2003 02:45") to a Date with format ("dd-MM-yyyy HH:mm")
 
These leads to the following code :
java.text.SimpleDateFormat dateFormat = new java.text.SimpleDateFormat(("dd-MM-yyyy HH:mm");
String dateStr = "30-03-2003 02:45";
java.util.Date date = dateFormat.parse(dateStr);
 
The date contains the value Sun Mar 30 03:45:00 CEST 2003
so +1 uur, this happens only for the dates from  30-03-2003 02:00 till 30-03-2003 02:59.
The other dates do come out right.
 
Can anybody help me ?
 
Bart Laeremans


---------------------------------------------------------------------
Gratis internet toegang en jouw @vt4.net adres op http://www.vt4.net