TimeStyle
- iOS
- 15.0+
- macOS
- 12.0+
- tvOS
- 15.0+
- watchOS
- 8.0+
typealias TimeStyle = Date.FormatStyle.TimeStyle
typealias TimeStyle = Date.FormatStyle.TimeStyle
s20FoundationEssentials4DateV0A20InternationalizationE19IntervalFormatStyleV04TimeG0a
What are these?2ZGIU
import FoundationEssentials
import FoundationInternationalization
struct IntervalFormatStyle
struct Date
Date
represents a single point in time.
struct FormatStyle
Strategies for formatting a Date
.
struct TimeStyle
Predefined time styles varied in lengths or the components included. The exact format depends on the locale.
init(date: Date.IntervalFormatStyle.DateStyle? = nil, time: Date.IntervalFormatStyle.TimeStyle? = nil, locale: Locale = .autoupdatingCurrent, calendar: Calendar = .autoupdatingCurrent, timeZone: TimeZone = .autoupdatingCurrent)
Creates a new FormatStyle
with the given configurations.
init(from decoder: any Decoder) throws
var calendar: Calendar
var locale: Locale
var timeZone: TimeZone
func day() -> Date.IntervalFormatStyle
func format(_ v: Range<Date>) -> String
func hour(_ format: Date.IntervalFormatStyle.Symbol.Hour = .defaultDigits(amPM: .abbreviated)) -> Date.IntervalFormatStyle
func locale(_ locale: Locale) -> Date.IntervalFormatStyle
func minute() -> Date.IntervalFormatStyle
func month(_ format: Date.IntervalFormatStyle.Symbol.Month = .abbreviated) -> Date.IntervalFormatStyle
func second() -> Date.IntervalFormatStyle
func timeZone(_ format: Date.IntervalFormatStyle.Symbol.TimeZone = .genericName(.short)) -> Date.IntervalFormatStyle
func weekday(_ format: Date.IntervalFormatStyle.Symbol.Weekday = .abbreviated) -> Date.IntervalFormatStyle
func year() -> Date.IntervalFormatStyle
typealias DateStyle = Date.FormatStyle.DateStyle
typealias Symbol = Date.FormatStyle.Symbol