eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'UtcTimestamp':

Home

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

Class: UtcTimestamp


Inheritance:

   Object
   |
   +--Magnitude
      |
      +--AbstractChronologyObject
         |
         +--AbstractTime
            |
            +--Timestamp
               |
               +--UtcTimestamp

Package:
stx:libbasic
Category:
Kernel-Chronology
Version:
rev: 1.21 date: 2023/06/06 16:05:40
user: cg
file: UtcTimestamp.st directory: libbasic
module: stx stc-classLibrary: libbasic

Description:


This is a Timestamp, that represents itself as UTC.
Internally it stores exactly the same value as Timestamp, 
so the following expression is always true:

    someTimestamp asUtcTimestamp = someTimestamp asLocalTimestamp

But when printing, accessing hour, minute, ... and converting to Date and Time,
it returns the values represented in the UTC zone instead of the local timezone.
Be aware that this may lead to interesting results; for example when converting a timestamp
to a date, you may get a different date from an UTCTimestamp and a local timestamp.


[instance variables:]

[class variables:]

copyright

COPYRIGHT (c) 2011 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.

Instance protocol:

accessing
o  timeInfo
(comment from inherited method)
fake an info which the OS cannot give me

o  timeZoneName

o  utcOffset
I am an UTC timestamp, so there is no offset

o  utcOffsetWithoutDst
I am an UTC timestamp, so there is no offset

converting
o  asLocalTimestamp
represent myself as a timestamp in the local timezone

o  asUtcTimestamp
I am an UtcTimestamp

initialization
o  setOSTimeFromYear: y month: m day: d hour: h minute: min second: s millisecond: millis
private: ask the operating system to compute the internal osTime (based on the epoch),
given y,m,d and h,m,s in utc time

private
o  storeStringClass
my storeString will ask Timestamp to read the instance

testing
o  isLocalTimestamp
return true, if I am a local timestamp (i.e. with no TZ info)

o  isUtcTimestamp
return true, if I am a utc timestamp

visiting
o  acceptVisitor: aVisitor with: aParameter
dispatch for visitor pattern; send #visitUtcTimestamp:with: to aVisitor.



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 08:36:23 GMT