I have a db, that stores dates in OleDateTime
format, in GMT timezone. I\'ve implemented a class, extending Date
in java to represent that in class
A Date is locale-independent, always using GMT timezone. It's just a wrapper around a millisecond timestamp in GMT (more correctly: UTC).
The only things in Date
that are timezone dependant are the deprecated methods like getDay()
- that's why they're deprecated. Those use the default time zone. The correct thing to do is to avoid using those deprecated methods - not to set the default timezone to UTC! That could cause problems elsewhere, and you can't prevent other parts of the code from setting the default timezone to something else.