16954
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2014 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
"{ Package: 'stx:libbasic' }"
|
|
13 |
|
|
14 |
Timestamp subclass:#TZTimestamp
|
|
15 |
instanceVariableNames:'utcOffset'
|
|
16 |
classVariableNames:''
|
|
17 |
poolDictionaries:''
|
|
18 |
category:'Magnitude-Time'
|
|
19 |
!
|
|
20 |
|
|
21 |
!TZTimestamp class methodsFor:'documentation'!
|
|
22 |
|
|
23 |
copyright
|
|
24 |
"
|
|
25 |
COPYRIGHT (c) 2014 by eXept Software AG
|
|
26 |
All Rights Reserved
|
|
27 |
|
|
28 |
This software is furnished under a license and may be used
|
|
29 |
only in accordance with the terms of that license and with the
|
|
30 |
inclusion of the above copyright notice. This software may not
|
|
31 |
be provided or otherwise made available to, or used by, any
|
|
32 |
other person. No title to or ownership of the software is
|
|
33 |
hereby transferred.
|
|
34 |
"
|
|
35 |
!
|
|
36 |
|
|
37 |
documentation
|
|
38 |
"
|
|
39 |
This class represents time values in milliSeconds starting some time in the past,
|
|
40 |
which were created in another (explicit) timezone.
|
|
41 |
Internally, they keep the milliseconds based on UTC time (just like the other timestamps),
|
|
42 |
so the time values can be compared easily.
|
|
43 |
However, wehn printed, the original timezone information is taken into account.
|
|
44 |
|
|
45 |
Also Note:
|
|
46 |
On UNIX, osTime can only hold dates between 1970-01-01T00:00:00Z and 2038-01-19T00:00:00Z
|
|
47 |
However, timestamp instances can now hold negative osTime values (which are timestamps
|
|
48 |
before 1.1.1970 and greater than 4294967295 (2^32-1) for timestamps after 2038-01-19.
|
|
49 |
|
|
50 |
[author:]
|
|
51 |
Claus Gittinger
|
|
52 |
|
|
53 |
[See also:]
|
|
54 |
Timestamp UtcTimestamp Time Date
|
|
55 |
"
|
|
56 |
! !
|
|
57 |
|
|
58 |
!TZTimestamp methodsFor:'accessing'!
|
|
59 |
|
|
60 |
utcOffset
|
|
61 |
"return the difference between UTC (Greenwich Mean Time) and the local time in seconds.
|
|
62 |
If daylight saving time applies to ourself, take that into account.
|
|
63 |
|
|
64 |
Add utcOffset to convert from local time to UTC time.
|
|
65 |
Subtract utcOffset to convert from UTC time to local time.
|
|
66 |
|
|
67 |
If utcOffset is negative, the local timezone is east of Greenwich.
|
|
68 |
If utcOffset is positive, the local timezone is west of Greenwich."
|
|
69 |
|
|
70 |
^ utcOffset
|
|
71 |
!
|
|
72 |
|
|
73 |
utcOffset:seconds
|
|
74 |
"set the difference between UTC (Greenwich Mean Time) and the local time in seconds.
|
|
75 |
If daylight saving time applies to ourself, take that into account.
|
|
76 |
|
|
77 |
Add utcOffset to convert from local time to UTC time.
|
|
78 |
Subtract utcOffset to convert from UTC time to local time.
|
|
79 |
|
|
80 |
If utcOffset is negative, the local timezone is east of Greenwich.
|
|
81 |
If utcOffset is positive, the local timezone is west of Greenwich."
|
|
82 |
|
|
83 |
utcOffset := seconds
|
|
84 |
! !
|
|
85 |
|
|
86 |
!TZTimestamp class methodsFor:'documentation'!
|
|
87 |
|
|
88 |
version
|
|
89 |
^ '$Header: /cvs/stx/stx/libbasic/TZTimestamp.st,v 1.1 2014-11-07 12:12:01 cg Exp $'
|
|
90 |
!
|
|
91 |
|
|
92 |
version_CVS
|
|
93 |
^ '$Header: /cvs/stx/stx/libbasic/TZTimestamp.st,v 1.1 2014-11-07 12:12:01 cg Exp $'
|
|
94 |
! !
|
|
95 |
|