public class DateUtils extends Object
Modifier and Type | Method and Description |
---|---|
static int |
compare(Calendar c1,
Calendar c2)
Compare to calendars.
|
static int |
dayOfMonth(Date inDate,
TimeZone timeZone)
Calculate the day of the month (1 - 31) for the given date.
|
static int |
dayOfWeek(Date inDate,
TimeZone timeZone)
Calculate the day number for the given date.
|
static int |
dayOfYear(Date forDate,
TimeZone timeZone)
Calculate the day of the year for the given
date.
|
static Date |
endOfDay(Date inDate,
TimeZone timeZone)
Calculate the date time at the end of the day (one millisecond before midnight)
for the given date.
|
static int |
month(Date inDate,
TimeZone timeZone)
Calcuate the month number (0 - 11) for the given date.
|
static Date |
oneMillisAfter(Date date)
Return a date which is 1 millisecond after the given date.
|
static Date |
oneMillisBefore(Date date)
Return a date which is 1 millisecond before the given date.
|
static Date |
startOfDay(Date inDate,
TimeZone timeZone)
Calculate the start of day date time (i.e.
|
public static Date startOfDay(Date inDate, TimeZone timeZone)
inDate
- The date to cacluate start of day from.public static Date endOfDay(Date inDate, TimeZone timeZone)
inDate
- The given date.public static int dayOfWeek(Date inDate, TimeZone timeZone)
inDate
- The given date.public static int month(Date inDate, TimeZone timeZone)
inDate
- The given date.public static int dayOfMonth(Date inDate, TimeZone timeZone)
inDate
- The given date.public static int dayOfYear(Date forDate, TimeZone timeZone)
forDate
- The date.public static Date oneMillisAfter(Date date)
date
- The given date.public static Date oneMillisBefore(Date date)
date
- The given date.