public class Date extends Date
Differs from java.sql.Date when
serialized/deserialized in different timezones. Databases don't provide a
time and therefore no timezone for a date, i.e. when sent over wire to different
locations a date should always remain the same for all timezones. In
java.sql.Data, however, the epochal time is serialized which may lead
to a different date when deserialized in another timezone. In Date
the effective date is serialized as YYYYMMDD to provide the same semantics
as databases do.
| Constructor and Description |
|---|
Date()
Creates the current date.
|
Date(long date)
Constructs a
Date object using the given milliseconds time value. |
| Modifier and Type | Method and Description |
|---|---|
Calendar |
getCalendar()
Gets the calendar for this date.
|
void |
setTime(long date) |
getHours, getMinutes, getSeconds, setHours, setMinutes, setSeconds, toInstant, toLocalDate, toString, valueOf, valueOfpublic Date(long date)
Date object using the given milliseconds time value. If the
given milliseconds value contains time information, the driver will set the
time components to the time in the default time zone (the time zone of the
Java virtual machine running the application) that corresponds to zero GMT.date - milliseconds since January 1, 1970, 00:00:00 GMT not to exceed
the milliseconds representation for the year 8099. A negative number
indicates the number of milliseconds before January 1, 1970, 00:00:00 GMT.public Date()
Tentackle - a domain driven enterprise framework