One Logo Pool Ball
Foundation · IOS API REFERENCE

Date.FormatStyle.Symbol.DayPeriod

struct · iOS 15.0+ · SDK 27.1

struct DayPeriod

A type that specifies a format for the time period in a date format style. The type ``Date/FormatStyle/Symbol/DayPeriod`` includes static factory methods that create custom ``Date/FormatStyle/Symbol/DayPeriod`` objects. |Factory variable|Description| |---|---| | ``conversational(_:)`` | Conversational abbreviated period. For example, `at night`, `nachm.`, `iltap`. ![](spacer) Conversational narrow period. For example, `at night`, `nachmittags`, `iltapäivällä`. ![](spacer) Conversational wide period. For example, `at night`, `nachm.`, `ip.` | | ``standard(_:)`` | Abbreviated period. For example, `am`. ![](spacer) Narrow period. For example, `a`. ![](spacer) Wide period. For example, `am`. | | ``with12s(_:)`` | Abbreviated period including designations for noon and midnight. For example, `mid.` ![](spacer) Narrow period including designations for noon and midnight. For example, `md`. ![](spacer) Wide period including designations for noon and midnight. For example, `midnight`. | The day period format style may be uppercase or lowercase depending on the locale and other options. For more information about formatting dates, see the ``Date/FormatStyle``.

Members (4)

static · iOS 15.0+

conversational

TypeScript
static conversational(width: Date_FormatStyle_Symbol_DayPeriod_Width): Date_FormatStyle_Symbol_DayPeriod
Swift declaration
static func conversational(_ width: Date.FormatStyle.Symbol.DayPeriod.Width) -> Date.FormatStyle.Symbol.DayPeriod

Conversational day period. For example, Abbreviated: `at night`, `nachm.`, `ip.` Wide: `at night`, `nachmittags`, `iltapäivällä`. Narrow: `at night`, `nachm.`, `iltap`.

get · iOS 18.0+

omitted

TypeScript
static get omitted(): Date_FormatStyle_Symbol_DayPeriod
Swift declaration
static let omitted: Date.FormatStyle.Symbol.DayPeriod

The option for not including the symbol in the formatted output.

static · iOS 15.0+

with12s

TypeScript
static with12s(width: Date_FormatStyle_Symbol_DayPeriod_Width): Date_FormatStyle_Symbol_DayPeriod
Swift declaration
static func with12s(_ width: Date.FormatStyle.Symbol.DayPeriod.Width) -> Date.FormatStyle.Symbol.DayPeriod

Day period including designations for noon and midnight. For example, Abbreviated: `mid` Wide: `midnight` Narrow: `md`.

static · iOS 15.0+

standard

TypeScript
static standard(width: Date_FormatStyle_Symbol_DayPeriod_Width): Date_FormatStyle_Symbol_DayPeriod
Swift declaration
static func standard(_ width: Date.FormatStyle.Symbol.DayPeriod.Width) -> Date.FormatStyle.Symbol.DayPeriod

Standard day period. For example, Abbreviated: `12 am.` Wide: `12 am` Narrow: `12a`.

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →