AMPMStyle
- iOS
- 15.0+
- macOS
- 12.0+
- tvOS
- 15.0+
- watchOS
- 8.0+
struct AMPMStyle
struct AMPMStyle
s20FoundationEssentials4DateV0A20InternationalizationE11FormatStyleV6SymbolV4HourV9AMPMStyleV
What are these?2KULC
import FoundationInternationalization
import FoundationEssentials
struct Hour
struct Date
Date
represents a single point in time.
struct FormatStyle
Strategies for formatting a Date
.
struct Symbol
static let omitted: Date.FormatStyle.Symbol.Hour
The option for not including the symbol in the formatted output.
static func conversationalDefaultDigits(amPM: Date.FormatStyle.Symbol.Hour.AMPMStyle) -> Date.FormatStyle.Symbol.Hour
Behaves like defaultDigits
: the preferred numeric hour format for the locale with minimum digits. May also use conversational period formats.
static func conversationalTwoDigits(amPM: Date.FormatStyle.Symbol.Hour.AMPMStyle) -> Date.FormatStyle.Symbol.Hour
Behaves like twoDigits
: two-digit hour format for the locale, zero padded if necessary. May also use conversational period formats.
static func defaultDigits(amPM: Date.FormatStyle.Symbol.Hour.AMPMStyle) -> Date.FormatStyle.Symbol.Hour
The preferred numeric hour format for the locale with minimum digits. Whether the period symbol (AM/PM) will be shown depends on the locale.
static func twoDigits(amPM: Date.FormatStyle.Symbol.Hour.AMPMStyle) -> Date.FormatStyle.Symbol.Hour
The preferred two-digit hour format for the locale, zero padded if necessary. Whether the period symbol (AM/PM) will be shown depends on the locale.
static var defaultDigitsNoAMPM: Date.FormatStyle.Symbol.Hour { get }
static var twoDigitsNoAMPM: Date.FormatStyle.Symbol.Hour { get }
protocol Decodable
A type that can decode itself from an external representation.
protocol Encodable
A type that can encode itself to an external representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol Sendable
init(from decoder: any Decoder) throws
static let abbreviated: Date.FormatStyle.Symbol.Hour.AMPMStyle
Abbreviated day period if the locale prefers using day period with hour. For example, 8
, 8 AM
, 13
, 1 PM
if used with defaultDigits
. Or 08
, 08 AM
, 13
, 01 PM
if used with twoDigits
.
static let narrow: Date.FormatStyle.Symbol.Hour.AMPMStyle
Narrow day period if the locale prefers using day period with hour. For example, 8
, 8a
, 13
, 1p
if used with defaultDigits
. Or 08
, 08a
, 13
, 01p
if used with twoDigits
.
static let omitted: Date.FormatStyle.Symbol.Hour.AMPMStyle
Hides the day period marker (AM/PM). For example, 8
(for 8 in the morning), 1
(for 1 in the afternoon) if used with defaultDigits
. Or 08
, 01
if used with twoDigits
.
static let wide: Date.FormatStyle.Symbol.Hour.AMPMStyle
Wide day period if the locale prefers using day period with hour. For example, 8
, 8 A.M.
, 13
, 1 P.M.
if used with defaultDigits
. Or, 08
, 08 A.M.
, 13
, 01 P.M.
if used with twoDigits
.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.