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

TimeFrame

data class TimeFrame(val number: Long, val unit: TimeUnit) : Comparable<TimeFrame>

Class denoting a length of time that is easily convertible into any required time units.

The class is Comparable for easy comparison. Although it should be noted that the comparison may not be reliable when comparing very large units with very small units as the conversions are taken from TimeUnit which will truncate limit conversions to Long.MAX_VALUE/Long.MIN_VALUE in cases when a conversion would exceed the max/min value.

Constructors

TimeFrame
Link copied to clipboard
constructor(number: Long, unit: TimeUnit)

Properties

number
Link copied to clipboard
val number: Long
unit
Link copied to clipboard
val unit: TimeUnit

Functions

asUnit
Link copied to clipboard
@JvmStatic
fun TimeFrame.asUnit(unit: TimeUnit): Long

Converts the current TimeFrame to the give unit

compareTo
Link copied to clipboard
open operator override fun compareTo(other: TimeFrame): Int
inDays
Link copied to clipboard
@JvmStatic
fun TimeFrame.inDays(): Long

Converts the current TimeFrame to days

inHours
Link copied to clipboard
@JvmStatic
fun TimeFrame.inHours(): Long

Converts the current TimeFrame to hours

inMilliseconds
Link copied to clipboard
@JvmStatic
fun TimeFrame.inMilliseconds(): Long

Converts the current TimeFrame to milliseconds

inMinutes
Link copied to clipboard
@JvmStatic
fun TimeFrame.inMinutes(): Long

Converts the current TimeFrame to minutes

inSeconds
Link copied to clipboard
@JvmStatic
fun TimeFrame.inSeconds(): Long

Converts the current TimeFrame to seconds

Generated by Dokka
(c) Tealium 2026