|
Class: TimeZone
Object
|
+--TimeZone
- Package:
- stx:libbasic
- Category:
- Kernel-Chronology
- Version:
- rev:
1.4
date: 2023/07/07 12:52:17
- user: cg
- file: TimeZone.st directory: libbasic
- module: stx stc-classLibrary: libbasic
TimeZone is a simple class to collect the information identifying a time zone.
TimeZone class >> #timeZones returns a dictionary of the known time zones
copyrightCOPYRIGHT (c) 2023 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
accessing
-
timeZones
-
return a dictionary containing timezone information by zone name.
This may or may not be correct by the time you read this.
It is recommended to add explicit information in the form of +hh:mm to a printed
representation, instead of using names.
This is also searched for when reverse converting from utcOffset to TZName
Usage example(s):
TimeZoneInfo := TimeZones := nil.
self timeZones
TZTimestamp now timeZoneName
|
instance creation
-
abbreviation: anAbbreviation
-
(self abbreviation:'JST') offset
(self abbreviation:'JST') utcOffset
-
name: anAbbreviation
-
(self name:'JST') offset
(self name:'JST') utcOffset
(self name:'xxx')
-
name: anAbbreviation ifUnknown: exceptionValue
-
(self abbreviation:'JST') offset
(self abbreviation:'JST') utcOffset
-
offset: aDuration name: aName abbreviation: anAbbreviation
-
Modified (format): / 06-06-2023 / 20:24:47 / cg
private
-
timezoneInfo
-
PRIVATE do not use; use timezoneTable.
return a table containing timezone information.
This may or may not be correct by the time you read this.
It is recommended to add explicit information in the form of +hh:mm to a printed
representation, instead of using names.
As this is searched for when reverse converting from utcOffset to TZName
Usage example(s):
TimeZoneInfo := nil. self timezoneInfo
|
-
timezoneInfo: a4ColumnTable
-
provided to allow updating the timezone info dynamically
(via a patch or automatic fetch from some official website
accessing
-
abbreviation
-
Modified (format): / 06-06-2023 / 18:44:27 / cg
-
abbreviation: aString
-
Modified (format): / 06-06-2023 / 18:44:32 / cg
-
abbreviation: abbreviationArg offsetInMinutes: offsetInMinutesArg isDST: isDSTArg name: nameArg
-
-
at: index
-
backward compatible (used to be a 3-element array in timezoneInfo)
-
isDST
-
-
isDST: aBoolean
-
-
name
-
Modified (format): / 06-06-2023 / 18:44:47 / cg
-
name: aString
-
Modified (format): / 06-06-2023 / 18:44:54 / cg
-
offset
-
(self new offsetInMinutes:30) offset => 30m
(self new offset:30 minutes) offset => 30m
(self new offset:30 minutes) offsetInMinutes => 30
-
offset: aDuration
-
self new offset:30 minutes
-
offsetInMinutes
-
-
offsetInMinutes: minutes
-
-
utcOffset
-
printing & storing
-
printOn: aStream
-
(self new offsetInMinutes:30)
(self new offsetInMinutes:-600)
|