| java.lang.Object org.apache.roller.util.DateUtil
DateUtil | abstract public class DateUtil (Code) | | General purpose date utilities.
|
Method Summary | |
public static String | defaultDate(Date date) | public static SimpleDateFormat | defaultDateFormat() | public static String | defaultTimestamp(Date date) | public static SimpleDateFormat | defaultTimestampFormat() | public static String | format(Date aDate, SimpleDateFormat aFormat) Returns a string the represents the passed-in date parsed
according to the passed-in format. | public static String | format6chars(Date date) | public static String | format8chars(Date date) | public static String | formatIso8601(Date date) | public static String | formatIso8601Day(Date date) | public static String | formatRfc822(Date date) | public static String | friendlyDate(Date date, boolean minimalFormat) Format the date using the "friendly" date format. | public static String | friendlyDate(Date date) | public static SimpleDateFormat | friendlyDateFormat(boolean minimalFormat) Returns a "friendly" date format. | public static String | friendlyTimestamp(Date date) | public static SimpleDateFormat | friendlyTimestampFormat() | public static String | fullDate(Date date) | public static SimpleDateFormat | fullDateFormat() | public static SimpleDateFormat | get6charDateFormat() | public static SimpleDateFormat | get8charDateFormat() | public static Date | getEndOfDay(Date day) Returns a Date set to the last possible millisecond of the day, just
before midnight. | public static Date | getEndOfDay(Date day, Calendar cal) | public static Date | getEndOfHour(Date day) Returns a Date set to the last possible millisecond of the day, just
before midnight. | public static Date | getEndOfHour(Date day, Calendar cal) | public static Date | getEndOfMonth(Date day) Returns a Date set to the last possible millisecond of the month, just
before midnight. | public static Date | getEndOfMonth(Date day, Calendar cal) | public static SimpleDateFormat | getIso8601DateFormat() | public static SimpleDateFormat | getIso8601DayDateFormat() | public static Date | getNoonOfDay(Date day, Calendar cal) Returns a Date set just to Noon, to the closest possible millisecond
of the day. | public static SimpleDateFormat | getRfc822DateFormat() | public static Date | getStartOfDay(Date day) Returns a Date set to the first possible millisecond of the day, just
after midnight. | public static Date | getStartOfDay(Date day, Calendar cal) Returns a Date set to the first possible millisecond of the day, just
after midnight. | public static Date | getStartOfMonth(Date day) Returns a Date set to the first possible millisecond of the month, just
after midnight. | public static Date | getStartOfMonth(Date day, Calendar cal) | public static boolean | isValidDateRange(Date startDate, Date endDate) Returns true if endDate is after startDate or if startDate equals endDate
or if they are the same date. | public static boolean | isValidDateRange(Date startDate, Date endDate, boolean equalOK) Returns true if endDate is after startDate or if startDate equals endDate.
Returns false if either value is null. | public static String | minimalDate(Date date) | public static java.text.SimpleDateFormat | minimalDateFormat() | public static java.sql.Timestamp | now() | public static Date | parse(String aValue, SimpleDateFormat aFormat) Returns a Date using the passed-in string and format. | public static Date | parseIso8601(String value) | public static Date | parseWeblogURLDateString(String dateString, TimeZone tz, Locale locale) Parse data as either 6-char or 8-char format. |
millisInDay | final public static long millisInDay(Code) | | |
format | public static String format(Date aDate, SimpleDateFormat aFormat)(Code) | | Returns a string the represents the passed-in date parsed
according to the passed-in format. Returns an empty string
if the date or the format is null.
|
friendlyDate | public static String friendlyDate(Date date, boolean minimalFormat)(Code) | | Format the date using the "friendly" date format.
|
friendlyDateFormat | public static SimpleDateFormat friendlyDateFormat(boolean minimalFormat)(Code) | | Returns a "friendly" date format.
Parameters: mimimalFormat - Should the date format allow single digits. |
getEndOfDay | public static Date getEndOfDay(Date day)(Code) | | Returns a Date set to the last possible millisecond of the day, just
before midnight. If a null day is passed in, a new Date is created.
midnight (00m 00h 00s)
|
getEndOfHour | public static Date getEndOfHour(Date day)(Code) | | Returns a Date set to the last possible millisecond of the day, just
before midnight. If a null day is passed in, a new Date is created.
midnight (00m 00h 00s)
|
getEndOfMonth | public static Date getEndOfMonth(Date day)(Code) | | Returns a Date set to the last possible millisecond of the month, just
before midnight. If a null day is passed in, a new Date is created.
midnight (00m 00h 00s)
|
getNoonOfDay | public static Date getNoonOfDay(Date day, Calendar cal)(Code) | | Returns a Date set just to Noon, to the closest possible millisecond
of the day. If a null day is passed in, a new Date is created.
nnoon (00m 12h 00s)
|
getStartOfDay | public static Date getStartOfDay(Date day)(Code) | | Returns a Date set to the first possible millisecond of the day, just
after midnight. If a null day is passed in, a new Date is created.
midnight (00m 00h 00s)
|
getStartOfDay | public static Date getStartOfDay(Date day, Calendar cal)(Code) | | Returns a Date set to the first possible millisecond of the day, just
after midnight. If a null day is passed in, a new Date is created.
midnight (00m 00h 00s)
|
getStartOfMonth | public static Date getStartOfMonth(Date day)(Code) | | Returns a Date set to the first possible millisecond of the month, just
after midnight. If a null day is passed in, a new Date is created.
midnight (00m 00h 00s)
|
isValidDateRange | public static boolean isValidDateRange(Date startDate, Date endDate)(Code) | | Returns true if endDate is after startDate or if startDate equals endDate
or if they are the same date. Returns false if either value is null.
|
isValidDateRange | public static boolean isValidDateRange(Date startDate, Date endDate, boolean equalOK)(Code) | | Returns true if endDate is after startDate or if startDate equals endDate.
Returns false if either value is null. If equalOK, returns true if the
dates are equal.
|
parse | public static Date parse(String aValue, SimpleDateFormat aFormat) throws ParseException(Code) | | Returns a Date using the passed-in string and format. Returns null if the string
is null or empty or if the format is null. The string must match the format.
|
parseWeblogURLDateString | public static Date parseWeblogURLDateString(String dateString, TimeZone tz, Locale locale)(Code) | | Parse data as either 6-char or 8-char format.
|
|
|