@Immutable public final class PDTWebDateHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static DateTimeFormatter |
XSD_DATE |
static DateTimeFormatter |
XSD_DATE_TIME |
static DateTimeFormatter |
XSD_TIME |
public static final DateTimeFormatter XSD_TIME
public static final DateTimeFormatter XSD_DATE
public static final DateTimeFormatter XSD_DATE_TIME
@Nullable public static OffsetDateTime parseOffsetDateTimeUsingMask(@Nonnull PDTMask<?>[] aMasks, @Nonnull @Nonempty String sDate)
aMasks - array of masks to use for parsing the stringsDate - string to parse for a date.@Nullable public static ZonedDateTime parseZonedDateTimeUsingMask(@Nonnull PDTMask<?>[] aMasks, @Nonnull @Nonempty String sDate, @Nullable ZoneId aDTZ)
aMasks - array of masks to use for parsing the stringsDate - string to parse for a date.aDTZ - The date/time zone to use. Optional.@Nonnull public static WithZoneId extractDateTimeZone(@Nonnull String sDate)
sDate - The date string.null WithZoneId, where the remaining
string to be parsed (never null) and and the extracted
time zone (may be null) are contained.@Nullable public static ZonedDateTime getDateTimeFromRFC822(@Nullable String sDate)
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
sDate - string to parse for a date. May be null.ZonedDateTime or if the passed String was
null.@Nullable public static OffsetDateTime getDateTimeFromW3C(@Nullable String sDate)
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
sDate - string to parse for a date. May be null.ZonedDateTime or if the input string was null.@Nullable public static ZonedDateTime getDateTimeFromW3COrRFC822(@Nullable String sDate)
sDate - string to parse for a date.@Nullable public static LocalDateTime getLocalDateTimeFromW3COrRFC822(@Nullable String sDate)
sDate - string to parse for a date.@Nullable public static String getAsStringRFC822(@Nullable ZonedDateTime aDateTime)
aDateTime - Date to print. May be null.null if the
parameter is null.@Nullable public static String getAsStringRFC822(@Nullable OffsetDateTime aDateTime)
aDateTime - Date to print. May be null.null if the
parameter is null.@Nullable public static String getAsStringRFC822(@Nullable LocalDateTime aDateTime)
aDateTime - Date to print. May be null.null if the
parameter is null.@Nullable public static String getAsStringW3C(@Nullable ZonedDateTime aDateTime)
aDateTime - Date to print. May not be null.@Nullable public static String getAsStringW3C(@Nullable OffsetDateTime aDateTime)
aDateTime - Date to print. May not be null.@Nullable public static String getAsStringW3C(@Nullable LocalDateTime aDateTime)
aDateTime - Date to print. May not be null.@Nonnull public static String getCurrentDateTimeAsStringRFC822()
@Nonnull public static String getCurrentDateTimeAsStringW3C()
@Nonnull public static DateTimeFormatter getXSDFormatterDateTime(@Nullable ZoneId aOverrideZoneID)
@Nullable public static LocalDateTime getLocalDateTimeFromXSD(@Nullable String sValue)
@Nullable public static String getAsStringXSD(@Nullable LocalDateTime aLDT)
@Deprecated @Nullable public static ZonedDateTime getDateTimeFromXSD(@Nullable String sValue)
getZonedDateTimeFromXSD(String)
insteadsValue - value to parse@Nullable public static ZonedDateTime getZonedDateTimeFromXSD(@Nullable String sValue)
@Deprecated @Nullable public static ZonedDateTime getDateTimeFromXSD(@Nullable String sValue, @Nullable ZoneId aZoneID)
getZonedDateTimeFromXSD(String,ZoneId) insteadsValue - value to parseaZoneID - Zone ID to use@Nullable public static ZonedDateTime getZonedDateTimeFromXSD(@Nullable String sValue, @Nullable ZoneId aZoneID)
@Nullable public static String getAsStringXSD(@Nullable ZonedDateTime aZDT)
@Nullable public static String getAsStringXSD(@Nonnull ZoneId aZoneID, @Nullable ZonedDateTime aZDT)
@Nullable public static OffsetDateTime getOffsetDateTimeFromXSD(@Nullable String sValue)
@Nullable public static String getAsStringXSD(@Nullable OffsetDateTime aODT)
@Nullable public static XMLOffsetDateTime getXMLOffsetDateTimeFromXSD(@Nullable String sValue)
@Nullable public static String getAsStringXSD(@Nullable XMLOffsetDateTime aODT)
@Nonnull public static DateTimeFormatter getXSDFormatterDate()
@Nullable public static OffsetDate getOffsetDateFromXSD(@Nullable String sValue)
@Nullable public static String getAsStringXSD(@Nullable OffsetDate aOD)
@Nullable public static XMLOffsetDate getXMLOffsetDateFromXSD(@Nullable String sValue)
@Nullable public static String getAsStringXSD(@Nullable XMLOffsetDate aOD)
@Nonnull public static DateTimeFormatter getXSDFormatterTime()
@Nullable public static OffsetTime getOffsetTimeFromXSD(@Nullable String sValue)
@Nullable public static String getAsStringXSD(@Nullable OffsetTime aOT)
@Nullable public static XMLOffsetTime getXMLOffsetTimeFromXSD(@Nullable String sValue)
@Nullable public static String getAsStringXSD(@Nullable XMLOffsetTime aOT)
Copyright © 2014–2022 Philip Helger. All rights reserved.