I am encountering a problem someone mentioned before (archived thread, but without solution).
I tried to set an sql.Date and a Timestamp to 0 (meaning all timeattributes = 0). Per definition,
that is a violation of the value range within the Timestamp (count from 1970) but not for the
sql.Date.
so I tried:
Date d = Date.valueOf("0000-00-00"); // 0002-11-30
Timestamp t = Timestamp.valueOf("0000-00-00 00:00:00.000000000"); // 0002-11-30 00:00:00.0
Can anyone explain to me these results?
Some other thoughts came to my mind:
1. a Timestamp should not accept this value at all (?!)
2. The sql.Date offers two Constructors. The first (year, month, day) is deprecated so I don't want
to use it. The second (milliseconds) counts from 1970 - sure, you can use negative time to get to
a date earlier than 1970, but this is
very uncomfortable