Class TimeUtils


  • public final class TimeUtils
    extends Object
    author Pascal Knueppel
    created at: 29.09.2019 - 21:17

    this class shall help by parsing timestamps send within a scim request
    • Field Detail

      • DEFAULT_INSTANT_FRACTIONAL_DIGITS_FORMAT

        public static final int DEFAULT_INSTANT_FRACTIONAL_DIGITS_FORMAT
        in case of Instant values which will be stored as String in JSON, it is required to keep the fractional digits even if the nano value of Instant is set to zero @see https://stackoverflow.com/questions/33025988/java-time-iso-date-format-with-fixed-millis-digits-in-java-8-and-later
        See Also:
        Constant Field Values
    • Constructor Detail

      • TimeUtils

        public TimeUtils()
    • Method Detail

      • parseDateTime

        public static Instant parseDateTime​(String dateTime)
        this method will try to parse the date time send in a scim resource request. Please not that the timestamp format must apply to the xsd:datetime definition from W3C XML-schema definition specification as pointed in RFC7643 in chapter 2.3.5
        Parameters:
        dateTime - the date time representation that should be parsed
        Returns:
        the parsed date time in UTC or null if the given parameter was null
        Throws:
        InvalidDateTimeRepresentationException - if the given string does not apply to the xsd:dateTime definition