Package kotlinx. datetime
Types
A special case of DateTimePeriod that only stores date components and has all time components equal to zero.
Thrown by date-time arithmetic operations if the result can not be computed or represented.
A difference between two instants, decomposed into date and time components.
A unit for measuring time.
The enumeration class representing the days of the week.
A time zone that is known to always have the same offset from UTC.
Thrown when attempting to construct a TimeZone with an invalid ID.
A moment in time.
The date part of LocalDateTime.
The representation of a specific civil date and time without a reference to a particular time zone.
The time part of LocalDateTime.
A time zone, provides the conversion between Instant and LocalDateTime values using a collection of rules specifying which LocalDateTime value corresponds to each Instant.
Functions
Returns a TimeSource that uses this Clock to mark a time instant and to find the amount of time elapsed since that mark.
Returns the fixed-offset time zone with the given UTC offset.
Combines this time's components with the specified LocalDate components into a LocalDateTime value.
Combines this time's components with the specified date components into a LocalDateTime value.
Combines this date's components with the specified LocalTime components into a LocalDateTime value.
Combines this date's components with the specified time components into a LocalDateTime value.
Constructs a new DateTimePeriod. If all the time components are zero, returns a DatePeriod.
Returns the number of whole days between two dates.
Returns the number of whole days between two instants in the specified timeZone.
Returns an instant that is the result of subtracting one unit from this instant.
Returns a date that is the result of subtracting components of DatePeriod from this date. The components are subtracted in the order from the largest units to the smallest, i.e. from years to days.
Returns a DatePeriod representing the difference between other and this
dates.
Returns an instant that is the result of subtracting the value number of the specified unit from this instant.
Returns an instant that is the result of subtracting components of DateTimePeriod from this instant. The components are subtracted in the order from the largest units to the smallest, i.e. from years to nanoseconds.
Returns an instant that is the result of subtracting one unit from this instant in the specified timeZone.
Returns a DateTimePeriod representing the difference between other and this
instants.
Returns a LocalDate that is the result of subtracting the value number of the specified unit from this date.
Returns an instant that is the result of subtracting the value number of the specified unit from this instant in the specified timeZone.
Returns the number of whole months between two dates.
Returns the number of whole months between two instants in the specified timeZone.
Finds the offset from UTC this time zone has at the specified instant of physical time.
Returns a DatePeriod representing the difference between this
and other dates.
Returns a DateTimePeriod representing the difference between this
and other instants.
Adds two DatePeriod instances.
Adds two DateTimePeriod instances.
Returns an instant that is the result of adding one unit to this instant.
Returns a date that is the result of adding components of DatePeriod to this date. The components are added in the order from the largest units to the smallest, i.e. from years to days.
Returns an instant that is the result of adding the value number of the specified unit to this instant.
Returns an instant that is the result of adding components of DateTimePeriod to this instant. The components are added in the order from the largest units to the smallest, i.e. from years to nanoseconds.
Returns a LocalDate that is the result of adding the value number of the specified unit to this date.
Parses the ISO-8601 duration representation as a DatePeriod.
Parses the ISO-8601 duration representation as a DateTimePeriod.
Constructs a DateTimePeriod from a Duration.
Converts this string representing an instant in ISO-8601 format including date and time components and the time zone offset to an Instant value.
Returns an instant that corresponds to this civil date/time value in the specified timeZone.
Returns an instant that corresponds to this civil date/time value that happens at the specified UTC offset.
Converts this kotlinx.datetime.Instant value to a java.time.Instant value.
Converts this kotlinx.datetime.LocalDate value to a java.time.LocalDate value.
Converts this kotlinx.datetime.LocalDateTime value to a java.time.LocalDateTime value.
Converts this kotlinx.datetime.LocalDateTime value to a java.time.LocalTime value.
Converts this kotlinx.datetime.DatePeriod value to a java.time.Period value.
Converts this kotlinx.datetime.TimeZone value to a java.time.ZoneId value.
Converts this kotlinx.datetime.FixedOffsetTimeZone value to a java.time.ZoneOffset value.
Converts this kotlinx.datetime.UtcOffset value to a java.time.ZoneOffset value.
Converts this java.time.Period value to a kotlinx.datetime.DatePeriod value.
Converts this java.time.ZoneOffset value to a kotlinx.datetime.FixedOffsetTimeZone value.
Converts the NSDate to the corresponding Instant.
Converts this java.time.Instant value to a kotlinx.datetime.Instant value.
Converts this java.time.LocalDate value to a kotlinx.datetime.LocalDate value.
Converts this java.time.LocalDateTime value to a kotlinx.datetime.LocalDateTime value.
Converts this java.time.LocalTime value to a kotlinx.datetime.LocalTime value.
Converts the NSTimeZone to the corresponding TimeZone.
Converts this java.time.ZoneId value to a kotlinx.datetime.TimeZone value.
Converts this java.time.ZoneOffset value to a kotlinx.datetime.UtcOffset value.
Converts this string representing a date in ISO-8601 format to a LocalDate value.
Converts this string representing a date/time value in ISO-8601 format including date and time components but without any time zone component to a LocalDateTime value.
Returns a civil date/time value that this instant has in the specified timeZone.
Converts this string representing a time value in ISO-8601 format to a LocalTime value.
Converts the given LocalDate to NSDateComponents.
Converts the TimeZone to NSTimeZone.
Returns the number of whole years between two dates.
Returns the number of whole years between two instants in the specified timeZone.
Properties
Returns true if the instant is Instant.DISTANT_FUTURE or later.
Returns true if the instant is Instant.DISTANT_PAST or earlier.