<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Date/FormatStyle/Symbol/DayPeriod",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation4DateV11FormatStyleV6SymbolV9DayPeriodV"
  },
  "title" : "Date.FormatStyle.Symbol.DayPeriod"
}
-->

# Date.FormatStyle.Symbol.DayPeriod

A type that specifies a format for the time period in a date format style.

```
struct DayPeriod
```

## Overview

The type [`Date.FormatStyle.Symbol.DayPeriod`](/documentation/Foundation/Date/FormatStyle/Symbol/DayPeriod) includes static factory methods that create custom [`Date.FormatStyle.Symbol.DayPeriod`](/documentation/Foundation/Date/FormatStyle/Symbol/DayPeriod) objects.

|Factory variable                                                                                            |Description                                                                                                                                                                                                                                                                   |
|------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|``doc://com.apple.foundation/documentation/Foundation/Date/FormatStyle/Symbol/DayPeriod/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.`             |
|``doc://com.apple.foundation/documentation/Foundation/Date/FormatStyle/Symbol/DayPeriod/standard(_:)``      |Abbreviated period. For example, `am`. ![](spacer) Narrow period. For example, `a`. ![](spacer) Wide period. For example, `am`.                                                                                                                                               |
|``doc://com.apple.foundation/documentation/Foundation/Date/FormatStyle/Symbol/DayPeriod/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`](/documentation/Foundation/Date/FormatStyle).

## Topics

### Modifying a Day Period

[`static func conversational(Date.FormatStyle.Symbol.DayPeriod.Width) -> Date.FormatStyle.Symbol.DayPeriod`](/documentation/Foundation/Date/FormatStyle/Symbol/DayPeriod/conversational(_:))

Static factory method that creates a custom day period format style using a conversational style.

[`static func standard(Date.FormatStyle.Symbol.DayPeriod.Width) -> Date.FormatStyle.Symbol.DayPeriod`](/documentation/Foundation/Date/FormatStyle/Symbol/DayPeriod/standard(_:))

Static factory method that creates a custom day period format style using a standard style.

[`static func with12s(Date.FormatStyle.Symbol.DayPeriod.Width) -> Date.FormatStyle.Symbol.DayPeriod`](/documentation/Foundation/Date/FormatStyle/Symbol/DayPeriod/with12s(_:))

Static factory method that creates a custom day period format style using a style that represents midday and midnight.

### Supporting Enumerations

[`enum Width`](/documentation/Foundation/Date/FormatStyle/Symbol/DayPeriod/Width)

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

### Comparing Day Periods

[`static func == (Date, Date) -> Bool`](/documentation/Foundation/Date/==(_:_:))

Returns true if the two `Date` values represent the same point in time.

### Type Properties

[`static let omitted: Date.FormatStyle.Symbol.DayPeriod`](/documentation/Foundation/Date/FormatStyle/Symbol/DayPeriod/omitted)

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

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)