Class TikaDates
D:, EXIF, RFC 5322 and other month-name forms,
ctime, slash dates, 8/12/14-digit strings) and must match that family whole; there is no
prefix matching. Thread-safe.
Rules: years outside 1000..2200 and offsets outside -12:00..+14:00 are rejected; the calendar is proleptic Gregorian as written; slash dates are month-first unless the first field is over 12 (day-first) or over 31 (yy/M/d); two-digit years 00-49 are 20xx (RFC 5322); named zones are fixed offsets (EDT is -4 all year) and an unknown 2-5 letter name means the zone is unknown (RFC 5322 4.3); a date-only value has no zone even if one was written.
Producer quirks accepted: HH:mmss, HH.mm.ss, one-digit seconds, trailing
:cc after seconds, Z00:00, apostrophes in offsets (-06'00'),
AM/PM after an ISO time, D: followed by ISO, a trailing (comment), a missing
sign on a 0000 offset, and, in mail forms only, junk after a complete time and
numeric offset. Inputs over 256 characters are rejected unread.
Storage (TikaDates.ParsedDate.toMetadataString()): explicit zone -> canonical UTC ...Z;
no zone -> yyyy-MM-dd'T'HH:mm:ss; date-only -> yyyy-MM-dd. Reading back
(TikaDates.ParsedDate.toInstant()) treats no zone as UTC and date-only as midday UTC.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe offset is null when the source had none.static enum -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleaninYearBounds(Instant instant) For dates decoded from binary fields.static Stringstatic Optional<TikaDates.ParsedDate> static StringtoMetadataString(String raw) static String
-
Field Details
-
MIN_YEAR
public static final int MIN_YEAR- See Also:
-
MAX_YEAR
public static final int MAX_YEAR- See Also:
-
-
Method Details
-
parse
-
normalize
- Returns:
- canonical UTC string for a full-precision date, else null
-
toMetadataString
- Returns:
TikaDates.ParsedDate.toMetadataString()for a full-precision date, else null
-
toMetadataStringKeepPartial
-
inYearBounds
For dates decoded from binary fields.
-