Package-level declarations

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val Calendar.hour: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val Calendar.minute: Int
Link copied to clipboard
val Calendar.month: Int
Link copied to clipboard
val Calendar.second: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val Calendar.year: Int

Functions

Link copied to clipboard
fun Calendar.format(pattern: String): String

Formats a Calendar into a date-time String.

fun Date.format(pattern: String): String

Formats a Date into a date-time String.

fun Instant.format(pattern: String): String

Formats a Instant into a date-time String.

fun LocalDate.format(pattern: String): String

Formats a LocalDate into a date-time String.

fun LocalDateTime.format(pattern: String): String

Formats a LocalDateTime into a date-time String.

fun LocalTime.format(pattern: String): String

Formats a LocalTime into a date-time String.

Link copied to clipboard
infix fun Calendar.isSameDay(date: Calendar): Boolean
infix fun Date.isSameDay(date: Date): Boolean
infix fun Instant.isSameDay(date: Instant): Boolean
infix fun LocalDate.isSameDay(date: LocalDate): Boolean
infix fun LocalDateTime.isSameDay(date: LocalDateTime): Boolean

Two days are considered to be the same if they have the same day.

Link copied to clipboard
operator fun Calendar.minus(other: Calendar): Calendar
operator fun Date.minus(other: Date): Date
operator fun LocalDate.minus(duration: Duration): LocalDate
operator fun LocalDateTime.minus(duration: Duration): LocalDateTime
operator fun LocalTime.minus(duration: Duration): LocalTime

Subtracts the other value from this value.

operator fun Calendar.minus(other: Duration): Calendar

Subtracts the Duration value from this Calendar.

operator fun Date.minus(other: Duration): Date

Subtracts the Duration value from this Date.

Link copied to clipboard
fun LocalDate.Companion.now(timeZone: TimeZone = TimeZone.currentSystemDefault()): LocalDate

Get current LocalDate.

fun LocalDateTime.Companion.now(timeZone: TimeZone = TimeZone.currentSystemDefault()): LocalDateTime

Get current LocalDateTime.

fun LocalTime.Companion.now(timeZone: TimeZone = TimeZone.currentSystemDefault()): LocalTime

Get current LocalTime.

Link copied to clipboard
operator fun Calendar.plus(other: Calendar): Calendar
operator fun Date.plus(other: Date): Date
operator fun LocalDate.plus(duration: Duration): LocalDate
operator fun LocalDateTime.plus(duration: Duration): LocalDateTime
operator fun LocalTime.plus(duration: Duration): LocalTime

Adds the other value to this value.

operator fun Calendar.plus(other: Duration): Calendar

Adds the Duration value to this Calendar.

operator fun Date.plus(other: Duration): Date

Adds the Duration value to this Date.

Link copied to clipboard

Convert Date to Calendar.

fun Long.toCalendar(): Calendar

Convert Long to Calendar.

fun Duration.toCalendar(): Calendar

Convert Duration to Calendar.

fun Instant.toCalendar(): Calendar

Convert Instant to Calendar.

fun LocalDate.toCalendar(): Calendar

Convert LocalDate to Calendar.

fun LocalDateTime.toCalendar(): Calendar

Convert LocalDateTime to Calendar.

fun LocalTime.toCalendar(): Calendar

Convert LocalTime to Calendar.

@JvmOverloads
fun String.toCalendar(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Calendar

Produce a Calendar from the given strings value and pattern.

Link copied to clipboard
@JvmOverloads
fun String.toCalendarOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Calendar?

Produce a Calendar from the given strings value and pattern if possible.

Link copied to clipboard

Convert Calendar to Date.

fun Long.toDate(): Date

Convert Long to Date.

fun Duration.toDate(): Date

Convert Duration to Date.

fun Instant.toDate(): Date

Convert Instant to Date.

fun LocalDate.toDate(): Date

Convert LocalDate to Date.

fun LocalDateTime.toDate(): Date

Convert LocalDateTime to Date.

fun LocalTime.toDate(): Date

Convert LocalTime to Date.

@JvmOverloads
fun String.toDate(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Date

Produce a date from the given strings value and pattern.

Link copied to clipboard
@JvmOverloads
fun String.toDateOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Date?

Produce a date from the given strings value and pattern if possible.

Link copied to clipboard
fun Long.toInstant(): Instant

Convert Long to Instant.

fun String.toInstant(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Instant

Produce an Instant from the given strings value and pattern.

Link copied to clipboard
fun String.toInstantOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Instant?

Produce an Instant from the given strings value and pattern if possible.

Link copied to clipboard
fun Calendar.toLocalDate(): LocalDate

Convert Calendar to LocalDate.

fun Date.toLocalDate(): LocalDate

Convert Date to LocalDate.

fun Long.toLocalDate(): LocalDate

Convert Long to LocalDate.

fun LocalDateTime.toLocalDate(): LocalDate

Convert LocalDateTime to LocalDate.

fun String.toLocalDate(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): LocalDate

Produce a LocalDate from the given strings value and pattern.

fun Instant.toLocalDate(timeZone: TimeZone = TimeZone.currentSystemDefault()): LocalDate

Convert Instant to LocalDate.

Link copied to clipboard
fun String.toLocalDateOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): LocalDate?

Produce a LocalDate from the given strings value and pattern if possible.

Link copied to clipboard
fun Calendar.toLocalDateTime(): LocalDateTime

Convert Calendar to LocalDateTime.

fun Date.toLocalDateTime(): LocalDateTime

Convert Date to LocalDateTime.

fun Long.toLocalDateTime(): LocalDateTime

Convert Long to LocalDateTime.

fun LocalDate.toLocalDateTime(): LocalDateTime

Convert LocalDate to LocalDateTime.

fun String.toLocalDateTime(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): LocalDateTime

Produce a LocalDateTime from the given strings value and pattern.

Link copied to clipboard
fun String.toLocalDateTimeOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): LocalDateTime?

Produce a LocalDateTime from the given strings value and pattern if possible.

Link copied to clipboard
fun Calendar.toLocalTime(): LocalTime

Convert Calendar to LocalTime.

fun Date.toLocalTime(): LocalTime

Convert Date to LocalTime.

fun Long.toLocalTime(): LocalTime

Convert Long to LocalTime.

fun LocalDateTime.toLocalTime(): LocalTime

Convert LocalDateTime to LocalTime.

fun String.toLocalTime(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): LocalTime

Produce a LocalTime from the given strings value and pattern.

fun Instant.toLocalTime(timeZone: TimeZone = TimeZone.currentSystemDefault()): LocalTime

Convert Instant to LocalTime.

Link copied to clipboard
fun String.toLocalTimeOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): LocalTime?

Produce a LocalTime from the given strings value and pattern if possible.

Link copied to clipboard
fun Calendar.toString(format: String): String

Formats a Calendar into a date-time String.

fun Date.toString(format: String): String

Formats a Date into a date-time String.

fun Instant.toString(format: String): String

Formats a Instant into a date-time String.

fun LocalDate.toString(format: String): String

Formats a LocalDate into a date-time String.

fun LocalDateTime.toString(format: String): String

Formats a LocalDateTime into a date-time String.

fun LocalTime.toString(format: String): String

Formats a LocalTime into a date-time String.