I have a class that has a date field representing a \"valid from\" date for a piece of data. It is defined like this:
@Temporal( TemporalType.DATE )
private
Very sorry but all of the answers so far are generally incorrect. The answer is quite simple but requires that we separate five points:
Summary: Use UTC (GMT+0) on the server, in the database, in your Java objects.
DATE and TIMESTAMP are only different from a database perspective in that TIMESTAMP carries additional fractions of seconds. Both use GMT+0 (implied). JodaTime is a preferred calendar framework to deal with all of this but won't fix the issues of mismatched JVM to database time-zone settings.
If application designs from JVM to the DB do not use GMT, due to daylight-savings, clock adjustments and all kinds of other regional games that are played in the world local clocks ... the times of transactions and everything else will forever be skewed, non-referential, inconsistent, etc.
Another good related answer about data types: java.util.Date vs java.sql.Date
Also note that Java 8 has updates with better date/time handling (finally) but this does not fix having the server clock the JVM is running on be in one timezone and the database be in another. At this point there is always translation happening. In every large (smart) client I work with, the database and JVM server timezones are set to UTC for this very reason, even if their operations largely occur in some other timezone.