DateTimeFormat

sealed interface DateTimeFormat<T>(source)

A format for parsing and formatting datetime-related values.

By convention, predefined formats for each applicable class can be found in the Formats object of the class, and custom formats can be created using the Format function in the companion object of that class. For example, LocalDate.Formats contains predefined formats for LocalDate, and LocalDate.Format can be used to define new ones.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun format(value: T): String

Formats the given value into a string using this format.

Link copied to clipboard

Uses this format to format an unstructured DateTimeComponents.

Link copied to clipboard
abstract fun <A : Appendable> formatTo(appendable: A, value: T): A

Formats the given value into the given appendable using this format.

Link copied to clipboard
abstract fun parse(input: CharSequence): T

Parses the given input string as T using this format.

Link copied to clipboard
abstract fun parseOrNull(input: CharSequence): T?

Parses the given input string as T using this format.