Class 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
    • Method Detail

      • parseOAIDate

        public static Instant parseOAIDate​(String date)
        Parses the given string from the OAI protocol into an Instant. 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.