Finite

data class Finite(val time: Long, val days: Int, val months: Int) : PgInterval

Represents a finite PostgreSQL interval.

Constructors

Link copied to clipboard
constructor(time: Long, days: Int, months: Int)

Properties

Link copied to clipboard
val days: Int

The number of days in the interval.

Link copied to clipboard
val months: Int

The number of months in the interval.

Link copied to clipboard
val time: Long

The time part of the interval in microseconds.

Functions

Link copied to clipboard
fun PgInterval.toDateTimePeriod(): DateTimePeriod

Converts this PgInterval to a Kotlinx DateTimePeriod.

Link copied to clipboard

Converts by flattening everything to microseconds, assuming (like PostgreSQL justify_interval): 1 month = 30 days, 1 day = 24 hours.

Link copied to clipboard

Converts strictly. The interval cannot have days and months set, because they have variable length in the calendar.