Skip to main content

isoformat

Returns a string representing the date or time in ISO 8601 format.

def isoformat(
o: datetime.date | datetime.time
) - > string

Converts a date or time object into its ISO 8601 formatted string representation.

Parameters

NameTypeDescription
o`datetime.datedatetime.time`

Returns

TypeDescription
stringThe ISO 8601 formatted string representing the provided date or time object.