formatted(date:time:)

Converts self to its textual representation that contains both the date and time parts. The exact format depends on the user’s preferences.

iOS
15.0+
macOS
12.0+
tvOS
15.0+
watchOS
8.0+
func formatted(date: Date.FormatStyle.DateStyle, time: Date.FormatStyle.TimeStyle) -> String

Parameters

date

The style for describing the date part.

time

The style for describing the time part.

Returns

A String describing self.