Package io.ktor.util.date

Types

Link copied to clipboard
data class GMTDate : Comparable<GMTDate>

Date in GMT timezone

Link copied to clipboard
class GMTDateParser(pattern: String)

Build GMTDate parser using pattern string.

Link copied to clipboard
class InvalidDateStringException(data: String, at: Int, pattern: String) : IllegalStateException

Thrown when the date string doesn't the string pattern.

Link copied to clipboard
class InvalidTimestampException(timestamp: Long) : IllegalStateException

Invalid exception: possible overflow or underflow

Link copied to clipboard
enum Month : Enum<Month>

Month value is 3 letter shortcut

Link copied to clipboard
enum WeekDay : Enum<WeekDay>

Day of week value is 3 letter shortcut

Functions

Link copied to clipboard
expect fun getTimeMillis(): Long

Gets current system time in milliseconds since certain moment in the past, only delta between two subsequent calls makes sense.

actual fun getTimeMillis(): Long

Gets current system time in milliseconds since certain moment in the past, only delta between two subsequent calls makes sense.

actual fun getTimeMillis(): Long

Gets current system time in milliseconds since certain moment in the past, only delta between two subsequent calls makes sense.

actual fun getTimeMillis(): Long

Gets current system time in milliseconds since certain moment in the past, only delta between two subsequent calls makes sense.

Link copied to clipboard
expect fun GMTDate(timestamp: Long? = null): GMTDate

Create new gmt date from the timestamp.

expect fun GMTDate(seconds: Int, minutes: Int, hours: Int, dayOfMonth: Int, month: Month, year: Int): GMTDate

Create an instance of GMTDate from the specified date/time components

actual fun GMTDate(timestamp: Long? = null): GMTDate

Create new gmt date from the timestamp.

actual fun GMTDate(seconds: Int, minutes: Int, hours: Int, dayOfMonth: Int, month: Month, year: Int): GMTDate

Create an instance of GMTDate from the specified date/time components

actual fun GMTDate(timestamp: Long? = null): GMTDate

Create new gmt date from the timestamp.

actual fun GMTDate(seconds: Int, minutes: Int, hours: Int, dayOfMonth: Int, month: Month, year: Int): GMTDate

Create an instance of GMTDate from the specified date/time components

actual fun GMTDate(timestamp: Long? = null): GMTDate

Create new gmt date from the timestamp.

actual fun GMTDate(seconds: Int, minutes: Int, hours: Int, dayOfMonth: Int, month: Month, year: Int): GMTDate

Create an instance of GMTDate from the specified date/time components

Link copied to clipboard
operator fun GMTDate.minus(milliseconds: Long): GMTDate

Subtracts the specified number of milliseconds

operator fun GMTDate.minus(duration: Duration): GMTDate

Subtracts the specified duration

Link copied to clipboard
operator fun GMTDate.plus(milliseconds: Long): GMTDate

Adds the specified number of milliseconds

operator fun GMTDate.plus(duration: Duration): GMTDate

Adds the specified duration

Link copied to clipboard
fun Calendar.toDate(timestamp: Long?): GMTDate
Link copied to clipboard
fun GMTDate.toJvmDate(): Date

Convert to Date

Link copied to clipboard
fun GMTDate.truncateToSeconds(): GMTDate

Truncate to seconds by discarding sub-second part