Enumerationswift 6.0.1FoundationEssentials
DateTimeSeparator
- iOS
- 15.0+
- macOS
- 12.0+
- tvOS
- 15.0+
- watchOS
- 8.0+
enum DateTimeSeparator
enum DateTimeSeparator
s20FoundationEssentials4DateV18ISO8601FormatStyleV0C13TimeSeparatorO
What are these?5ADZ
import FoundationEssentials
struct ISO8601FormatStyle
Options for generating and parsing string representations of dates following the ISO 8601 standard.
struct Date
Date
represents a single point in time.
case space
case standard
init(dateSeparator: Date.ISO8601FormatStyle.DateSeparator = .dash, dateTimeSeparator: Date.ISO8601FormatStyle.DateTimeSeparator = .standard, timeSeparator: Date.ISO8601FormatStyle.TimeSeparator = .colon, timeZoneSeparator: Date.ISO8601FormatStyle.TimeZoneSeparator = .omitted, includingFractionalSeconds: Bool = false, timeZone: TimeZone = TimeZone(secondsFromGMT: 0)!)
init(dateSeparator: Date.ISO8601FormatStyle.DateSeparator = .dash, dateTimeSeparator: Date.ISO8601FormatStyle.DateTimeSeparator = .standard, timeZone: TimeZone = TimeZone(secondsFromGMT: 0)!)
init(from decoder: any Decoder) throws
var dateSeparator: Date.ISO8601FormatStyle.DateSeparator { get }
var dateTimeSeparator: Date.ISO8601FormatStyle.DateTimeSeparator { get }
var formatFields: Date.ISO8601FormatStyle.Fields { get }
var includingFractionalSeconds: Bool { get }
var parseStrategy: Date.ISO8601FormatStyle { get }
var timeSeparator: Date.ISO8601FormatStyle.TimeSeparator { get }
var timeZone: TimeZone { get set }
The time zone to use to create and parse date representations.
var timeZoneSeparator: Date.ISO8601FormatStyle.TimeZoneSeparator { get }
static func == (lhs: Date.ISO8601FormatStyle, rhs: Date.ISO8601FormatStyle) -> Bool
func consuming(_ input: String, startingAt index: String.Index, in bounds: Range<String.Index>) throws -> (upperBound: String.Index, output: Date)?
func dateSeparator(_ separator: Date.ISO8601FormatStyle.DateSeparator) -> Date.ISO8601FormatStyle
func dateTimeSeparator(_ separator: Date.ISO8601FormatStyle.DateTimeSeparator) -> Date.ISO8601FormatStyle
func day() -> Date.ISO8601FormatStyle
func encode(to encoder: any Encoder) throws
func format(_ value: Date) -> String
func hash(into hasher: inout Hasher)
func month() -> Date.ISO8601FormatStyle
func parse(_ value: String) throws -> Date
func parse(_ value: String, in range: Range<String.Index>) -> (String.Index, Date)?
func time(includingFractionalSeconds: Bool) -> Date.ISO8601FormatStyle
func timeSeparator(_ separator: Date.ISO8601FormatStyle.TimeSeparator) -> Date.ISO8601FormatStyle
func timeZone(separator: Date.ISO8601FormatStyle.TimeZoneSeparator) -> Date.ISO8601FormatStyle
func timeZoneSeparator(_ separator: Date.ISO8601FormatStyle.TimeZoneSeparator) -> Date.ISO8601FormatStyle
func weekOfYear() -> Date.ISO8601FormatStyle
func year() -> Date.ISO8601FormatStyle
enum DateSeparator
struct Fields
enum TimeSeparator
enum TimeZoneSeparator
typealias RegexOutput = Date
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 RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
protocol Sendable
init?(rawValue: String)
init(from decoder: any Decoder) throws
Creates a new instance by decoding from the given decoder, when the type’s RawValue
is String
.
var hashValue: Int { get }
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
func encode(to encoder: any Encoder) throws
Encodes this value into the given encoder, when the type’s RawValue
is String
.
func hash(into hasher: inout Hasher)