DateUtils

Utility object for consistent time and date formatting across the SDK.

Functions

Link copied to clipboard
@RequiresApi(value = 26)
open override fun iso8601Local(instant: Instant, timeZone: ZoneId): String
open override fun iso8601Local(date: Date, timeZone: TimeZone): String

Returns an ISO-8601 date format using device default as the time zone

Link copied to clipboard
@RequiresApi(value = 26)
open override fun iso8601LocalWithOffset(instant: Instant, timeZone: ZoneId): String
open override fun iso8601LocalWithOffset(date: Date, timeZone: TimeZone): String

Returns an ISO-8601 date format using device default as the time zone, including the timezone offset.

Link copied to clipboard
@RequiresApi(value = 26)
open override fun iso8601Utc(instant: Instant): String
open override fun iso8601Utc(date: Date): String

Returns an ISO-8601 date format using UTC as the time zone

Link copied to clipboard
@RequiresApi(value = 26)
open override fun offsetInHours(instant: Instant, timeZone: ZoneId): Double
open override fun offsetInHours(date: Date, timeZone: TimeZone): Double

Returns the timezone offset in hours, as a Double. Where the integral part of the returned Double is the whole number of hours, and the fractional part is the minutes.