public final class DateUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_DATE_FORMAT
Default date pattern
|
static String |
DEFAULT_DATETIME_FORMAT
Default datetime pattern
|
| Modifier and Type | Method and Description |
|---|---|
static String |
convertDayOfWeekToCron(Object dayOfWeek) |
static Calendar |
dayEnd()
Returns the end of the day (23:59:59:999) for today.
|
static Calendar |
dayEnd(Calendar date)
Returns the end of the day (23:59:59:999) for the specified date.
|
static Calendar |
dayStart()
Returns the start of the day (00:00:00:000) for today.
|
static Calendar |
dayStart(Calendar date)
Returns the start of the day (00:00:00:000) for the specified date.
|
static String |
formatDurationWords(long durationMillis)
Returns a human-readable representation of the time taken.
|
static Integer |
getDayOfWeek(String dayOfWeek)
Returns the
Calendar's day of week number, which corresponds to the provided day of week string. |
static String |
getDayOfWeekEndCron(List<String> daysOfWeek)
Returns the the end of the day cron expression (Quartz scheduler) for the specified days of week.
|
static String |
getDayOfWeekStartCron(List<String> daysOfWeek)
Returns the the start of the day cron expression (Quartz scheduler) for the specified days of week.
|
public static final String DEFAULT_DATE_FORMAT
public static final String DEFAULT_DATETIME_FORMAT
public static Calendar dayEnd()
date - the date to be processedpublic static Calendar dayEnd(Calendar date)
date - the date to be processedpublic static Calendar dayStart()
public static Calendar dayStart(Calendar date)
date - the date to be processedpublic static Integer getDayOfWeek(String dayOfWeek)
Calendar's day of week number, which corresponds to the provided day of week string. If the name is unknown,
null is returned.dayOfWeek - the day of week nameCalendar's day of week number, which corresponds to the provided day of week string. If the name is unknown,
null is returnedpublic static String getDayOfWeekEndCron(List<String> daysOfWeek)
daysOfWeek - the day of week listpublic static String getDayOfWeekStartCron(List<String> daysOfWeek)
daysOfWeek - the day of week listpublic static String formatDurationWords(long durationMillis)
durationMillis - the time take in millisecondsDurationFormatUtils.formatDurationWords(long, boolean, boolean)Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.