According to this, I should always get a date in this format when I call toString:
dow mon dd hh:mm:ss zzz yyyy
Sometimes I get this format on Linux RHEL 3 (yeah I know that is REALLY OLD but I cannot update) using Java 1.6.
yyyy mon dd hh:mm:ss.xxxx
Saving the date to an H2 database via hiberante/spring and reading it back again seams to change the format that is produced by java.util.Date.toString().
If I populate a date d1 with java.util.Calendar.getTime() and I save d1 to a H2 database and read it back into a second date object d2 I make the following observations:
(1) d1.toString() produces the dow mon dd hh:mm:ss zzz yyyy format
(2) d2.toString() produces yyy mo dd hh:mm:ss.xxx and this is contrary to the documentation!
(2) assertTrue(d1.equals(d2)) fails.
(3) If I extract the year, month, day, hour, minute, second from cal1 and cal2 where cal1 and cal2 are populated from d1 and d2 via Calendar.setTime, the year, month day, hour, minute, seconds match!