One Logo Pool Ball
Foundation · IOS API REFERENCE

Date.HTTPFormatStyle

struct · iOS 26.0+ · SDK 27.1

struct HTTPFormatStyle

Options for generating and parsing string representations of dates following the HTTP date format from [RFC 9110 § 5.6.7](https://www.rfc-editor.org/rfc/rfc9110.html#http.date).

Members (5)

get · iOS 26.0+

parseStrategy

TypeScript
get parseStrategy(): Date_HTTPFormatStyle
Swift declaration
var parseStrategy: Date.HTTPFormatStyle { get }

A `ParseStrategy` that can be used to parse this `FormatStyle`'s output

method · iOS 26.0+

parse

TypeScript
parse(value: string): globalThis.Date
Swift declaration
func parse(_ value: String) throws -> Date

Parses a value, using this strategy. This method throws an error if the parse strategy can't parse `value`. - Parameter value: A value whose type matches the strategy's ``ParseStrategy/ParseInput`` type. - Returns: A parsed value of the type declared by ``ParseStrategy/ParseOutput``.

method · iOS 26.0+

format

TypeScript
format(date: globalThis.Date): string
Swift declaration
func format(_ date: Date) -> String

Formats a value, using this style. Use this method when you want to create a single style instance, and then use it to format multiple values. - Parameter value: The value to format. - Returns: A representation of `value`, in the ``FormatOutput`` type, formatted according to the style's configuration.

method · iOS 26.0+

consuming

TypeScript
consuming(input: string, index: SDKHandle, bounds: SDKHandle): ({ "upperBound": SDKHandle; "output": globalThis.Date }) | null
Swift declaration
func consuming(_ input: String, startingAt index: String.Index, in bounds: Range<String.Index>) throws -> (upperBound: String.Index, output: Date)?

Process the input string within the specified bounds, beginning at the given index, and return the end position (upper bound) of the match and the produced output. - Parameters: - input: The string in which the match is performed. - index: An index of `input` at which to begin matching. - bounds: The bounds in `input` in which the match is performed. - Returns: The upper bound where the match terminates and a matched instance, or `nil` if there isn't a match.

init · iOS 26.0+

init

TypeScript
static init(): Date_HTTPFormatStyle
Swift declaration
init()

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →