Example usage for Java org.apache.commons.lang.time DateUtils fields, constructors, methods, implement or subclass
The text is from its open source code.
long | MILLIS_PER_SECOND Number of milliseconds in a standard second. |
long | MILLIS_PER_MINUTE Number of milliseconds in a standard minute. |
long | MILLIS_PER_HOUR Number of milliseconds in a standard hour. |
long | MILLIS_PER_DAY Number of milliseconds in a standard day. |
int | SEMI_MONTH This is half a month, so this represents whether a date is in the top or bottom half of the month. |
int | RANGE_WEEK_SUNDAY A week range, starting on Sunday. |
int | RANGE_WEEK_MONDAY A week range, starting on Monday. |
int | RANGE_WEEK_RELATIVE A week range, starting on the day focused. |
DateUtils() DateUtils instances should NOT be constructed in standard programming. |
Date | add(Date date, int calendarField, int amount) Adds to a date returning a new object. |
Date | addDays(Date date, int amount) Adds a number of days to a date returning a new object. |
Date | addHours(Date date, int amount) Adds a number of hours to a date returning a new object. |
Date | addMilliseconds(Date date, int amount) Adds a number of milliseconds to a date returning a new object. |
Date | addMinutes(Date date, int amount) Adds a number of minutes to a date returning a new object. |
Date | addMonths(Date date, int amount) Adds a number of months to a date returning a new object. |
Date | addSeconds(Date date, int amount) Adds a number of seconds to a date returning a new object. |
Date | addWeeks(Date date, int amount) Adds a number of weeks to a date returning a new object. |
Date | addYears(Date date, int amount) Adds a number of years to a date returning a new object. |
Date | ceiling(Date date, int field) Ceil this date, leaving the field specified as the most significant field. For example, if you had the datetime of 28 Mar 2002 13:45:01.231, if you passed with HOUR, it would return 28 Mar 2002 14:00:00.000. |
Calendar | ceiling(Calendar date, int field) Ceil this date, leaving the field specified as the most significant field. For example, if you had the datetime of 28 Mar 2002 13:45:01.231, if you passed with HOUR, it would return 28 Mar 2002 13:00:00.000. |
Date | ceiling(Object date, int field) Ceil this date, leaving the field specified as the most significant field. For example, if you had the datetime of 28 Mar 2002 13:45:01.231, if you passed with HOUR, it would return 28 Mar 2002 13:00:00.000. |
long | getFragmentInDays(Date date, int fragment) Returns the number of days within the fragment. |
long | getFragmentInDays(Calendar calendar, int fragment) Returns the number of days within the fragment. |
long | getFragmentInHours(Date date, int fragment) Returns the number of hours within the fragment. |
long | getFragmentInHours(Calendar calendar, int fragment) Returns the number of hours within the fragment. |
long | getFragmentInMinutes(Date date, int fragment) Returns the number of minutes within the fragment. |
long | getFragmentInMinutes(Calendar calendar, int fragment) Returns the number of minutes within the fragment. |
boolean | isSameDay(Date date1, Date date2) Checks if two date objects are on the same day ignoring time. 28 Mar 2002 13:45 and 28 Mar 2002 06:01 would return true. |
boolean | isSameDay(Calendar cal1, Calendar cal2) Checks if two calendar objects are on the same day ignoring time. 28 Mar 2002 13:45 and 28 Mar 2002 06:01 would return true. |
boolean | isSameInstant(Date date1, Date date2) Checks if two date objects represent the same instant in time. This method compares the long millisecond time of the two objects. |
boolean | isSameInstant(Calendar cal1, Calendar cal2) Checks if two calendar objects represent the same instant in time. This method compares the long millisecond time of the two objects. |
Iterator | iterator(Date focus, int rangeStyle) This constructs an For instance, passing Thursday, July 4, 2002 and a This method provides an iterator that returns Calendar objects. |
Iterator | iterator(Calendar focus, int rangeStyle) This constructs an For instance, passing Thursday, July 4, 2002 and a This method provides an iterator that returns Calendar objects. |
Iterator> | iterator(Object focus, int rangeStyle) This constructs an For instance, passing Thursday, July 4, 2002 and a |
Date | parseDate(String str, String... parsePatterns) Parses a string representing a date by trying a variety of different parsers. The parse will try each parse pattern in turn. |
Date | parseDateStrictly(String str, String... parsePatterns) Parses a string representing a date by trying a variety of different parsers. The parse will try each parse pattern in turn. |
Date | round(Date date, int field) Round this date, leaving the field specified as the most significant field. For example, if you had the datetime of 28 Mar 2002 13:45:01.231, if this was passed with HOUR, it would return 28 Mar 2002 14:00:00.000. |
Calendar | round(Calendar date, int field) Round this date, leaving the field specified as the most significant field. For example, if you had the datetime of 28 Mar 2002 13:45:01.231, if this was passed with HOUR, it would return 28 Mar 2002 14:00:00.000. |
Date | round(Object date, int field) Round this date, leaving the field specified as the most significant field. For example, if you had the datetime of 28 Mar 2002 13:45:01.231, if this was passed with HOUR, it would return 28 Mar 2002 14:00:00.000. |
Date | setDays(Date date, int amount) Sets the day of month field to a date returning a new object. |
Date | setHours(Date date, int amount) Sets the hours field to a date returning a new object. |
Date | setMilliseconds(Date date, int amount) Sets the miliseconds field to a date returning a new object. |
Date | setMinutes(Date date, int amount) Sets the minute field to a date returning a new object. |
Date | setMonths(Date date, int amount) Sets the months field to a date returning a new object. |
Date | setSeconds(Date date, int amount) Sets the seconds field to a date returning a new object. |
Date | setYears(Date date, int amount) Sets the years field to a date returning a new object. |
Calendar | toCalendar(Date date) Convert a Date into a Calendar . |
Date | truncate(Date date, int field) Truncate this date, leaving the field specified as the most significant field. For example, if you had the datetime of 28 Mar 2002 13:45:01.231, if you passed with HOUR, it would return 28 Mar 2002 13:00:00.000. |
Calendar | truncate(Calendar date, int field) Truncate this date, leaving the field specified as the most significant field. For example, if you had the datetime of 28 Mar 2002 13:45:01.231, if you passed with HOUR, it would return 28 Mar 2002 13:00:00.000. |
Date | truncate(Object date, int field) Truncate this date, leaving the field specified as the most significant field. For example, if you had the datetime of 28 Mar 2002 13:45:01.231, if you passed with HOUR, it would return 28 Mar 2002 13:00:00.000. |
int | truncatedCompareTo(Calendar cal1, Calendar cal2, int field) Determines how two calendars compare up to no more than the specified most significant field. |
int | truncatedCompareTo(Date date1, Date date2, int field) Determines how two dates compare up to no more than the specified most significant field. |