public class DateUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.TimeZone |
MIDDAY
Custom time zone used to interpret date values without a time
component in a way that most likely falls within the same day
regardless of in which time zone it is later interpreted.
|
static java.util.TimeZone |
UTC
The UTC time zone.
|
Constructor and Description |
---|
DateUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
formatDate(java.util.Calendar date)
Returns a ISO 8601 representation of the given date.
|
static java.lang.String |
formatDate(java.util.Date date)
Returns a ISO 8601 representation of the given date.
|
static java.lang.String |
formatDateUnknownTimezone(java.util.Date date)
Returns a ISO 8601 representation of the given date, which is
in an unknown timezone.
|
java.util.Date |
tryToParse(java.lang.String dateString)
Tries to parse the date string; returns null if no parse was possible.
|
public static final java.util.TimeZone UTC
TimeZone.getTimeZone(String)
understands "UTC" in all environments, but it'll fall back to GMT
in such cases, which is in practice equivalent to UTC.public static final java.util.TimeZone MIDDAY
public static java.lang.String formatDate(java.util.Date date)
date
- given datepublic static java.lang.String formatDate(java.util.Calendar date)
date
- given datepublic static java.lang.String formatDateUnknownTimezone(java.util.Date date)
date
- given datepublic java.util.Date tryToParse(java.lang.String dateString)
DateUtils
for each class.dateString
- "Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"