Class TimeUtils
- java.lang.Object
-
- de.captaingoldfish.scim.sdk.common.utils.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 Summary
Fields Modifier and Type Field Description static 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-laterstatic String
XSD_DATE_TIME_FORMAT
the fully qualified xsd-datetime definition
-
Constructor Summary
Constructors Constructor Description TimeUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Instant
parseDateTime(String dateTime)
this method will try to parse the date time send in a scim resource 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
-
XSD_DATE_TIME_FORMAT
public static final String XSD_DATE_TIME_FORMAT
the fully qualified xsd-datetime definition
-
-
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
-
-