Package com.sinch.sdk.core.utils
Class DateUtil
java.lang.Object
com.sinch.sdk.core.utils.DateUtil
Utility class for Date
-
Method Summary
Modifier and TypeMethodDescriptionstatic Instant
failSafeTimeStampToInstant
(String value) Convert String to Instantstatic Instant
toInstant
(OffsetDateTime value) Convert an OffsetDateTime to Instant with null value protection
-
Method Details
-
toInstant
Convert an OffsetDateTime to Instant with null value protection- Parameters:
value
- Value to be converted- Returns:
- Converted value to Instant or null if source value was null
- Since:
- 1.0
-
failSafeTimeStampToInstant
Convert String to InstantConsume a date time in form of
- ISO8601 with TZ
- YYYY-MM-DDThh:mm:ss.SSS without timezone
- YYYY-MM-DDThh:mm:ss.SSSZ with timezone
- Parameters:
value
- A nearly IS08601 compliant string- Returns:
- Extracted Instant value
- Since:
- 1.1
-