|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jzeno.util.DateUtils
public class DateUtils
Helper operation for date manipulation, mainly to help working with UTC dates and local dates. Makes life a little easier ;-).
Constructor Summary | |
---|---|
DateUtils()
|
Method Summary | |
---|---|
static java.util.Date |
addDays(java.util.Date original,
int days)
This operation is useful to add or subtract a certain number of days to or from a given original date. |
static java.util.Date |
addHours(java.util.Date original,
int hours)
This operation adds a specified number of hours to a given date object. |
static java.util.Date |
endOfDay(java.util.Date arbitraryTimeInDay)
Convenience method to set the time portion of a Date object to 23:59:59.997, end of day. |
static java.util.Date |
endOfWeek(java.util.Date arbitraryDateInWeek)
Convenience method to calculate sunday, 23:59:59.999 of the week the supplied date belongs to. |
static java.lang.String |
formatDate(java.util.Date date)
Use this function for formatting a date according to the configured DateFormat implementation (in configuration.properties) |
static java.lang.String |
formatDate(java.util.Date date,
java.lang.String formatString)
Use this function for formatting a date according to the supplied date format. |
static java.lang.String |
formatTime(java.util.Date time)
Use this function for formatting a time according to the configured DateFormat implementation (in configuration.properties) |
static java.util.Date |
getCurrentUTCDate()
This operation returns the current time in UTC. |
static java.util.Date |
startOfDay(java.util.Date arbitraryTimeInDay)
Convenience method to set the time portion of a Date object to 00:00:00, start of day. |
static java.util.Date |
startOfWeek(java.util.Date arbitraryDateInWeek)
Convenience method to calculate monday, 00:00:00.000 of the week the supplied date belongs to. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DateUtils()
Method Detail |
---|
public static java.util.Date addDays(java.util.Date original, int days)
This operation is useful to add or subtract a certain number of days to or from a given original date.
public static java.util.Date addHours(java.util.Date original, int hours)
This operation adds a specified number of hours to a given date object.
public static java.util.Date startOfDay(java.util.Date arbitraryTimeInDay)
Convenience method to set the time portion of a Date object to 00:00:00, start of day.
public static java.util.Date endOfDay(java.util.Date arbitraryTimeInDay)
Convenience method to set the time portion of a Date object to 23:59:59.997, end of day.
public static java.util.Date startOfWeek(java.util.Date arbitraryDateInWeek)
Convenience method to calculate monday, 00:00:00.000 of the week the supplied date belongs to.
public static java.util.Date endOfWeek(java.util.Date arbitraryDateInWeek)
Convenience method to calculate sunday, 23:59:59.999 of the week the supplied date belongs to.
public static java.lang.String formatDate(java.util.Date date)
Use this function for formatting a date according to the configured DateFormat implementation (in configuration.properties)
public static java.lang.String formatDate(java.util.Date date, java.lang.String formatString)
Use this function for formatting a date according to the supplied date format.
public static java.lang.String formatTime(java.util.Date time)
Use this function for formatting a time according to the configured DateFormat implementation (in configuration.properties)
public static java.util.Date getCurrentUTCDate()
This operation returns the current time in UTC.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |