Companion

object Companion

Functions

fromDayOfUnixEpoch
Link copied to clipboard
common
fun fromDayOfUnixEpoch(day: Long): Date

Creates a Date from the day of the Unix epoch.

fromDaysSinceUnixEpoch
Link copied to clipboard
common
fun fromDaysSinceUnixEpoch(days: Days): Date

Creates a Date from a duration of days relative to the Unix epoch of 1970-01-01.

Properties

MAX
Link copied to clipboard
common
val MAX: Date

The latest supported Date, which can be used as a "far future" sentinel.

MIN
Link copied to clipboard
common
val MIN: Date

The earliest supported Date, which can be used as a "far past" sentinel.

Extensions

fromWeekDate
Link copied to clipboard
common
fun Date.Companion.fromWeekDate(year: Int, week: Int, day: Int): Date

Creates a Date from an ISO week date.

fun Date.Companion.fromWeekDate(year: Int, week: Int, day: Int, settings: WeekSettings): Date

Creates a Date from a week date representation using the week definition in settings.

fun Date.Companion.fromWeekDate(year: Int, week: Int, day: Int, locale: Locale): Date

Creates a Date from a week date representation using the week definition associated with the provided locale.

now
Link copied to clipboard
fun Date.Companion.now(clock: Clock): Date

Gets the current Date from the provided clock.

common
fun Date.Companion.now(): Date

Gets the current Date from the system clock.

common
fun Date.Companion.now(clock: Clock): Date

Gets the current Date from the provided clock.