Format
actual fun Format(builder: DateTimeFormatBuilder.WithDateTime.() -> Unit): DateTimeFormat<LocalDateTime>(source)
expect fun Format(builder: DateTimeFormatBuilder.WithDateTime.() -> Unit): DateTimeFormat<LocalDateTime>(source)
Creates a new format for parsing and formatting LocalDateTime values.
Examples:
// `2020-08-30 18:43:13`, using predefined date and time formats
LocalDateTime.Format { date(LocalDate.Formats.ISO); char(' '); time(LocalTime.Formats.ISO) }
// `08/30 18:43:13`, using a custom format:
LocalDateTime.Format {
monthNumber(); char('/'); dayOfMonth()
char(' ')
hour(); char(':'); minute()
optional { char(':'); second() }
}
Content copied to clipboard
Only parsing and formatting of well-formed values is supported. If the input does not fit the boundaries (for example, dayOfMonth is 31 for February), consider using DateTimeComponents.Format instead.
There is a collection of predefined formats in LocalDateTime.Formats.
actual fun Format(builder: DateTimeFormatBuilder.WithDateTime.() -> Unit): DateTimeFormat<LocalDateTime>(source)
actual fun Format(builder: DateTimeFormatBuilder.WithDateTime.() -> Unit): DateTimeFormat<LocalDateTime>(source)