StructureFoundationEssentials
Date.FormatString
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
A type that represents a fixed date format string using string interpolation.
struct FormatString
Overview
Use Date.FormatString with Date.VerbatimFormatStyle or Date.ParseStrategy to create fixed-pattern format strings for dates. You build format strings using string interpolation with date field symbols:
let format: Date.FormatString = "\(year: .defaultDigits)-\(month: .twoDigits)-\(day: .twoDigits)"
Topics
Default Implementations
Relationships
Conforms To
Swift.CopyableSwift.EquatableSwift.EscapableSwift.ExpressibleByExtendedGraphemeClusterLiteralSwift.ExpressibleByStringInterpolationSwift.ExpressibleByStringLiteralSwift.ExpressibleByUnicodeScalarLiteralSwift.HashableSwift.SendableSwift.SendableMetatype