All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.islandtime._Conversions.kt Maven / Gradle / Ivy

The newest version!
//
// This file is auto-generated by 'tools:code-generator'
//
@file:JvmMultifileClass
@file:JvmName("DateTimesKt")

package io.islandtime

import kotlin.jvm.JvmMultifileClass
import kotlin.jvm.JvmName

/**
 * Returns this year-month with the precision reduced to the year.
 */
fun YearMonth.toYear(): Year = Year(year)

/**
 * Returns this date with the precision reduced to the year.
 */
fun Date.toYear(): Year = Year(year)

/**
 * Returns this date with the precision reduced to the month.
 */
fun Date.toYearMonth(): YearMonth = YearMonth(year, month)

/**
 * Returns this date-time with the precision reduced to the year.
 */
fun DateTime.toYear(): Year = date.toYear()

/**
 * Returns this date-time with the precision reduced to the month.
 */
fun DateTime.toYearMonth(): YearMonth = date.toYearMonth()

/**
 * Returns this date-time with the precision reduced to the year.
 */
fun OffsetDateTime.toYear(): Year = dateTime.toYear()

/**
 * Returns this date-time with the precision reduced to the month.
 */
fun OffsetDateTime.toYearMonth(): YearMonth = dateTime.toYearMonth()

/**
 * Returns this date-time with the precision reduced to the year.
 */
fun ZonedDateTime.toYear(): Year = dateTime.toYear()

/**
 * Returns this date-time with the precision reduced to the month.
 */
fun ZonedDateTime.toYearMonth(): YearMonth = dateTime.toYearMonth()




© 2015 - 2025 Weber Informatics LLC | Privacy Policy