public class IsoDateParsingUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
IsoDateParsingUtils.IsoDateFormat
Enumerations with the allowed date formats by the occurrence search service.
|
Modifier and Type | Field and Description |
---|---|
static DateTimeFormatter |
ISO_DATE_FORMATTER |
static String |
SIMPLE_ISO_DATE_STR_PATTERN |
static Pattern |
SIMPLE_ISO_PATTERN |
Modifier and Type | Method and Description |
---|---|
static IsoDateParsingUtils.IsoDateFormat |
getFirstDateFormatMatch(String value)
Iterates over all the OccurrenceDateFormat's and returns the first one that parses successfully the value.
|
static LocalDate |
parseDate(String value)
Parses a single date value.
|
static Range<LocalDate> |
parseDateRange(String value)
Parses a closed-open range of dates, using the most specific format for each side of the range.
|
static Temporal |
parseTemporal(String value)
Parses an ISO 8601-format date or date-time.
|
static TemporalAccessor |
stripOffsetOrZone(TemporalAccessor temporalAccessor,
boolean ignoreOffset)
Remove the offset, either ignoring it or using it to adjust the time.
|
static TemporalAccessor |
stripOffsetOrZoneExceptUTC(TemporalAccessor temporalAccessor,
boolean ignoreOffset)
Remove the offset, either ignoring it or using it to adjust the time, unless the offset is 0 (UTC).
|
public static final String SIMPLE_ISO_DATE_STR_PATTERN
public static final Pattern SIMPLE_ISO_PATTERN
public static final DateTimeFormatter ISO_DATE_FORMATTER
public static IsoDateParsingUtils.IsoDateFormat getFirstDateFormatMatch(String value) throws IllegalArgumentException
IllegalArgumentException
- in case of unparsable datespublic static Temporal parseTemporal(String value)
public static LocalDate parseDate(String value)
IllegalArgumentException
- in case of unparsable datespublic static Range<LocalDate> parseDateRange(String value)
public static TemporalAccessor stripOffsetOrZone(TemporalAccessor temporalAccessor, boolean ignoreOffset)
public static TemporalAccessor stripOffsetOrZoneExceptUTC(TemporalAccessor temporalAccessor, boolean ignoreOffset)
Copyright © 2024 Global Biodiversity Information Facility (GBIF). All rights reserved.