Skip to content

StructureFoundationEssentials

DateComponents.HTTPFormatStyle

iOS 26.0+ iPadOS 26.0+ Mac Catalyst 26.0+ macOS 26.0+ tvOS 26.0+ visionOS 26.0+ watchOS 26.0+
Converts DateComponents into RFC 9110-compatible “HTTP date” String, and parses in the reverse direction. This parser does not do validation on the individual values of the components. An optional date can be created from the result using Calendar(identifier: .gregorian).date(from: ...). When formatting, missing or invalid fields are filled with default values: Sun, 01, Jan, 2000, 00:00:00, GMT. Note that missing fields may result in an invalid date or time. Other values in the DateComponents are ignored.
struct HTTPFormatStyle

Topics

Initializers

Instance Methods

Default Implementations

Relationships

Conforms To

  • FormatStyle
  • ParseStrategy
  • ParseableFormatStyle
  • Swift.Copyable
  • Swift.Decodable
  • Swift.Encodable
  • Swift.Equatable
  • Swift.Escapable
  • Swift.Hashable
  • Swift.Sendable
  • Swift.SendableMetatype
  • _StringProcessing.CustomConsumingRegexComponent
  • _StringProcessing.RegexComponent