Format
actual fun Format(block: DateTimeFormatBuilder.WithUtcOffset.() -> Unit): DateTimeFormat<UtcOffset>(source)
expect fun Format(block: DateTimeFormatBuilder.WithUtcOffset.() -> Unit): DateTimeFormat<UtcOffset>(source)
Creates a new format for parsing and formatting UtcOffset values.
Example:
// `GMT` on zero, `+4:30:15`, using a custom format:
UtcOffset.Format {
optional("GMT") {
offsetHours(Padding.NONE); char(':'); offsetMinutesOfHour()
optional { char(':'); offsetSecondsOfMinute() }
}
}
Content copied to clipboard
Since UtcOffset values are rarely formatted and parsed on their own, instances of DateTimeFormat obtained here will likely need to be passed to DateTimeFormatBuilder.WithUtcOffset.offset in a format builder for a larger data structure.
There is a collection of predefined formats in UtcOffset.Formats.
actual fun Format(block: DateTimeFormatBuilder.WithUtcOffset.() -> Unit): DateTimeFormat<UtcOffset>(source)
actual fun Format(block: DateTimeFormatBuilder.WithUtcOffset.() -> Unit): DateTimeFormat<UtcOffset>(source)