Package de.pangaea.metadataportal.utils
Class ISODateFormatter
- java.lang.Object
-
- de.pangaea.metadataportal.utils.ISODateFormatter
-
public final class ISODateFormatter extends Object
Simple static class to create and parse ISO-8601 date stamps (used by OAI harvester): The used date formats are:- Long date:
uuuu-MM-dd'T'HH:mm:ss'Z'
- Short date:
uuuu-MM-dd
- Author:
- Uwe Schindler
- Long date:
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
formatElasticsearch(TemporalAccessor date)
Formats an Elasticsearch date.static String
formatOAIDate(TemporalAccessor date, boolean fineGranularity)
Formats an ISO date, according to the OAI granularity.static Instant
parseOAIDate(String date)
Parses the given string from the OAI protocol into anInstant
.
-
-
-
Method Detail
-
parseOAIDate
public static Instant parseOAIDate(String date)
Parses the given string from the OAI protocol into anInstant
. It accepts short and long dates (with time)
-
formatOAIDate
public static String formatOAIDate(TemporalAccessor date, boolean fineGranularity)
Formats an ISO date, according to the OAI granularity.
-
formatElasticsearch
public static String formatElasticsearch(TemporalAccessor date)
Formats an Elasticsearch date.
-
-