Target filter
Search Kotlin docs
  • Platforms
  • Tealium Prism Kotlin
core/com.tealium.prism.core.api.misc/DateFormatter

DateFormatter

interface DateFormatter

A class for formatting Instant and Date objects into common String formats.

Inheritors

DateUtils

Functions

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

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

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

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

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

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

offsetInHours
Link copied to clipboard
@RequiresApi(value = 26)
abstract fun offsetInHours(instant: Instant, timeZone: ZoneId): Double
abstract 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.

Generated by Dokka
(c) Tealium 2026