Skip to content

Instance MethodFoundationEssentials

time(includingFractionalSeconds:)

iOS 15.0+ iPadOS 15.0+ Mac Catalyst 15.0+ macOS 12.0+ tvOS 15.0+ watchOS 8.0+
Modifies the ISO 8601 date format style to include the time in the formatted output.
func time(includingFractionalSeconds: Bool) -> Date.ISO8601FormatStyle

Parameters

includingFractionalSeconds

Specifies whether the format style includes the fractional component of the seconds.

Return Value

An ISO 8601 date format style modified to include the time.

Discussion

The default Date.ISO8601FormatStyle includes the time but not the fractional seconds.