eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'TimeZone':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: TimeZone


Inheritance:

   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

Description:


TimeZone is a simple class to collect the information identifying a time zone.
TimeZone class >> #timeZones returns a dictionary of the known time zones

copyright

COPYRIGHT (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.

Class protocol:

accessing
o  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
o  abbreviation: anAbbreviation
(self abbreviation:'JST') offset
(self abbreviation:'JST') utcOffset

o  name: anAbbreviation
(self name:'JST') offset
(self name:'JST') utcOffset
(self name:'xxx')

o  name: anAbbreviation ifUnknown: exceptionValue
(self abbreviation:'JST') offset
(self abbreviation:'JST') utcOffset

o  offset: aDuration name: aName abbreviation: anAbbreviation
Modified (format): / 06-06-2023 / 20:24:47 / cg

private
o  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

o  timezoneInfo: a4ColumnTable
provided to allow updating the timezone info dynamically
(via a patch or automatic fetch from some official website


Instance protocol:

accessing
o  abbreviation
Modified (format): / 06-06-2023 / 18:44:27 / cg

o  abbreviation: aString
Modified (format): / 06-06-2023 / 18:44:32 / cg

o  abbreviation: abbreviationArg offsetInMinutes: offsetInMinutesArg isDST: isDSTArg name: nameArg

o  at: index
backward compatible (used to be a 3-element array in timezoneInfo)

o  isDST

o  isDST: aBoolean

o  name
Modified (format): / 06-06-2023 / 18:44:47 / cg

o  name: aString
Modified (format): / 06-06-2023 / 18:44:54 / cg

o  offset
(self new offsetInMinutes:30) offset => 30m
(self new offset:30 minutes) offset => 30m
(self new offset:30 minutes) offsetInMinutes => 30

o  offset: aDuration
self new offset:30 minutes

o  offsetInMinutes

o  offsetInMinutes: minutes

o  utcOffset

printing & storing
o  printOn: aStream
(self new offsetInMinutes:30)
(self new offsetInMinutes:-600)



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sun, 08 Sep 2024 02:40:08 GMT