One Logo Pool Ball
Foundation · IOS API REFERENCE

Date.FormatStyle.TimeStyle

struct · iOS 15.0+ · SDK 27.1

struct TimeStyle

Type that defines time styles varied in length or components included. The exact format depends on the locale. Possible time styles include ``omitted``, ``shortened``, ``standard``, and ``complete``. The following code sample shows a variety of time style format results using the `en_US` locale. ```swift let meetingDate = Date() meetingDate.formatted(date: .numeric, time: .omitted) // 10/17/2020 meetingDate.formatted(date: .numeric, time: .shortened) // 10/17/2020, 9:54 PM meetingDate.formatted(date: .numeric, time: .standard) // 10/17/2020, 9:54:29 PM meetingDate.formatted(date: .numeric, time: .complete) // 10/17/2020, 9:54:29 PM CDT meetingDate.formatted() // 10/17/2020, 9:54 PM ``` The default time style is ``shortened``.

Members (4)

get · iOS 15.0+

omitted

TypeScript
static get omitted(): Date_FormatStyle_TimeStyle
Swift declaration
static let omitted: Date.FormatStyle.TimeStyle

Excludes the time part.

get · iOS 15.0+

complete

TypeScript
static get complete(): Date_FormatStyle_TimeStyle
Swift declaration
static let complete: Date.FormatStyle.TimeStyle

For example, `4:29:24 PM PDT`, `16:29:24 GMT`.

get · iOS 15.0+

standard

TypeScript
static get standard(): Date_FormatStyle_TimeStyle
Swift declaration
static let standard: Date.FormatStyle.TimeStyle

For example, `4:29:24 PM`, `16:29:24`.

get · iOS 15.0+

shortened

TypeScript
static get shortened(): Date_FormatStyle_TimeStyle
Swift declaration
static let shortened: Date.FormatStyle.TimeStyle

For example, `04:29 PM`, `16:29`.

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →