commonMain.io.islandtime._Conversions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-metadata Show documentation
Show all versions of core-metadata Show documentation
A multiplatform library for working with dates and times
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