TimeZoneChange
final class TimeZoneChange : Model
A TimeZoneChange
model says that at a specific UTC Date the ship will adopt a given timezone, specified by abbreviation and UTC offset.
The ‘current’ TimeZoneChange is the one with the a start date in the most recent past. The timezone indicated by the current TimeZoneChange is in force until the next (in Date order) TimeZoneChange becomes current.
-
Declaration
Swift
static let schema: String
-
The TimeZoneChange’s ID, provisioned automatically.
Declaration
Swift
@ID var id: UUID?
-
The generated token value.
Declaration
Swift
@Field var startTime: Date
-
Abbreviation of the timezone, such as EST.
Declaration
Swift
@Field var timeZoneName: String
-
Foundation has a bunch of TimeZone Identifier strings for timezones, and they specify a timezone with more granularity than an EST-style abbreviation. For example,
America/Halifax
andAmerica/Puerto_Rico
are both in the AST timezone, but Halifax observes DST and Puerto Rico doesn’t.Declaration
Swift
@Field var timeZoneID: String
-
Declaration
Swift
init()
-
Initializes a new TimeZoneChange.
Declaration
Swift
init(startTime: Date, name: String, id: String) throws
Parameters
startTime
When the timezone goes into effect
offset
GMT offset in hours.
name
The abbreviated name for the timezone, e.g. “EST”.
id
The Apple identifier for the timezone, e.g. “America/New_York”.