Errros in formatting dates with milliseconds
807569Sep 28 2006 — edited Sep 28 2006I am writing a routine to convert a String to a Date.
I have created the following mask: "yyyy-MM-dd HH:mm:ss.SSSSS"
I pass this to SimpleDateFormat and then parse to return a java.util.Date.
The method works fine when the milliseconds are all zero, ie .00012. however when the milliseconds increase, the resuting time in the date object becomes anywhere from a minute to hours later than it should be.
For instance, "2006-09-28 10:23:16.214500" becomes
Thu Sep 28 10:26:50 EDT 2006 when the resulting date object is displayed.
Is this a bug with java 1.5?