One Logo Pool Ball
Foundation · IOS API REFERENCE

Date.FormatString

struct · iOS 15.0+ · SDK 27.1

struct FormatString

A type that represents a fixed date format string using string interpolation. 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: ```swift let format: Date.FormatString = "\(year: .defaultDigits)-\(month: .twoDigits)-\(day: .twoDigits)" ```

Members (2)

init · iOS 15.0+

init

TypeScript
static initStringLiteral(value: string): Date_FormatString
Swift declaration
init(stringLiteral value: String)

Creates an instance initialized to the given string value. - Parameter value: The value of the new instance.

init · iOS 15.0+

init

TypeScript
static initStringInterpolation(stringInterpolation: Date_FormatString_StringInterpolation): Date_FormatString
Swift declaration
init(stringInterpolation: Date.FormatString.StringInterpolation)

Creates an instance from a string interpolation. Most `StringInterpolation` types will store information about the literals and interpolations appended to them in one or more properties. `init(stringInterpolation:)` should use these properties to initialize the instance. - Parameter stringInterpolation: An instance of `StringInterpolation` which has had each segment of the string literal appended to it.

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →