Skip to content

Structure

Date.FormatStyle.Symbol.DayPeriod

iOS 15.0+ iPadOS 15.0+ Mac Catalyst 15.0+ macOS 12.0+ tvOS 15.0+ watchOS 8.0+
A type that specifies a format for the time period in a date format style.
struct DayPeriod

Overview

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. Conversational narrow period. For example, at night, nachmittags, iltapäivällä. Conversational wide period. For example, at night, nachm., ip.

standard(_:)

Abbreviated period. For example, am. Narrow period. For example, a. Wide period. For example, am.

with12s(_:)

Abbreviated period including designations for noon and midnight. For example, mid. Narrow period including designations for noon and midnight. For example, md. 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.

Topics

Type Properties

Type Methods

Enumerations

  • enum Width
    A type representing the width of a day period in a format style.

Relationships

Conforms To

  • Swift.Equatable
  • Swift.Hashable
  • Swift.Sendable
  • Swift.SendableMetatype