Package io.ktor.util.date

Types

GMTDate

data class GMTDate : Comparable<GMTDate>

Date in GMT timezone

Month

enum class Month

Month value is 3 letter shortcut

WeekDay

enum class WeekDay

Day of week value is 3 letter shortcut

Extensions for External Classes

java.time.Instant

java.time.ZonedDateTime

Functions

GMTDate

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

minus

operator fun GMTDate.minus(milliseconds: Long): GMTDate

Subtracts the specified number of milliseconds

plus

operator fun GMTDate.plus(milliseconds: Long): GMTDate

Adds the specified number of milliseconds

toJvmDate

fun GMTDate.toJvmDate(): Date

Convert to Date

truncateToSeconds

fun GMTDate.truncateToSeconds(): GMTDate

Truncate to seconds by discarding sub-second part