DateStyle
- iOS
- 16.0+
- macOS
- 13.0+
- tvOS
- 16.0+
- watchOS
- 9.0+
typealias DateStyle = Date.FormatStyle.DateStyle
typealias DateStyle = Date.FormatStyle.DateStyle
s17_StringProcessing14RegexComponentP30FoundationInternationalization0E10Essentials4DateVADE13ParseStrategyVRszrlE0H5Stylea
What are these?7WLDJ
where Self == Date.ParseStrategy
import _StringProcessing
import FoundationInternationalization
protocol RegexComponent<RegexOutput>
A type that represents a regular expression.
struct Date
Date
represents a single point in time.
struct FormatStyle
Strategies for formatting a Date
.
struct DateStyle
Predefined date styles varied in lengths or the components included. The exact format depends on the locale.
struct ParseStrategy
Options for parsing string representations of dates to create a Date
instance.
static func date(_ style: Date.FormatStyle.DateStyle, locale: Locale, timeZone: TimeZone, calendar: Calendar? = nil) -> Date.ParseStrategy
Creates a regex component to match a localized date string and capture the string as a Date
. The string is expected to follow the format of what Date.FormatStyle(date:locale:calendar:)
produces. Date
created by this regex component would be at 00:00:00 in the specified time zone.
static func date(format: Date.FormatString, locale: Locale, timeZone: TimeZone, calendar: Calendar? = nil, twoDigitStartDate: Date = Date(timeIntervalSince1970: 0)) -> Self
Creates a regex component to match a localized date string following the specified format and capture the string as a Date
.
static func dateTime(date: Date.FormatStyle.DateStyle, time: Date.FormatStyle.TimeStyle, locale: Locale, timeZone: TimeZone, calendar: Calendar? = nil) -> Date.ParseStrategy
Creates a regex component to match a localized date and time string and capture the string as a Date
. The date string is expected to follow the format of what Date.FormatStyle(date:time:locale:calendar:)
produces.
typealias TimeStyle = Date.FormatStyle.TimeStyle