toISO8601

fun LocalDateTime.toISO8601(): String

Formats this LocalDateTime as an ISO-8601 string with a trailing Z, always including seconds and dropping any fractional-seconds component (e.g. 2024-03-15T08:30:45.123 becomes "2024-03-15T08:30:45Z", and 2024-03-15T08:30 becomes "2024-03-15T08:30:00Z").

The Z labels the value as UTC; no zone conversion is performed. Extension function on LocalDateTime.

Return

the ISO-8601 string