author | Claus Gittinger <cg@exept.de> |
Thu, 02 Dec 1999 12:22:55 +0100 | |
changeset 5049 | d8279f59df21 |
parent 4999 | 9d424b34577e |
child 5390 | 5a7c0581cfce |
permissions | -rw-r--r-- |
1 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
159 | 3 |
All Rights Reserved |
1 | 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 |
||
275 | 13 |
AbstractTime subclass:#Time |
993
feaa62827c41
check for territory being #us (instead of #usa) when printing
Claus Gittinger <cg@exept.de>
parents:
699
diff
changeset
|
14 |
instanceVariableNames:'timeEncoding' |
feaa62827c41
check for territory being #us (instead of #usa) when printing
Claus Gittinger <cg@exept.de>
parents:
699
diff
changeset
|
15 |
classVariableNames:'' |
feaa62827c41
check for territory being #us (instead of #usa) when printing
Claus Gittinger <cg@exept.de>
parents:
699
diff
changeset
|
16 |
poolDictionaries:'' |
feaa62827c41
check for territory being #us (instead of #usa) when printing
Claus Gittinger <cg@exept.de>
parents:
699
diff
changeset
|
17 |
category:'Magnitude-General' |
1 | 18 |
! |
19 |
||
2706
878723bc99fc
added #shortPrintString for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1701
diff
changeset
|
20 |
!Time class methodsFor:'documentation'! |
88 | 21 |
|
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
159 | 25 |
All Rights Reserved |
88 | 26 |
|
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
36 |
documentation |
|
37 |
" |
|
38 |
Instances of time represent a particular time-of-day. |
|
409 | 39 |
Since they only store hours, minutes and seconds within a day, |
40 |
they cannot be used to compare times across midnight |
|
41 |
(i.e. they should not be used as timeStamps). |
|
1228 | 42 |
|
241 | 43 |
Use instances of AbsoluteTime (and read the comment there) to do this. |
44 |
||
45 |
Examples: |
|
1228 | 46 |
|t| |
241 | 47 |
|
1228 | 48 |
t := Time now. |
1422 | 49 |
Transcript showCR:t. |
241 | 50 |
|
51 |
||
1228 | 52 |
|t1 t2| |
241 | 53 |
|
1228 | 54 |
t1 := Time now. |
55 |
(Delay forSeconds:10) wait. |
|
56 |
t2 := Time now. |
|
57 |
t2 - t1 |
|
1295 | 58 |
|
59 |
[author:] |
|
60 |
Claus Gittinger |
|
61 |
||
62 |
[see also:] |
|
1302 | 63 |
Date AbsoluteTime AbstractTime OperatingSystem |
1295 | 64 |
Filename |
88 | 65 |
" |
66 |
! ! |
|
1 | 67 |
|
2706
878723bc99fc
added #shortPrintString for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1701
diff
changeset
|
68 |
!Time class methodsFor:'instance creation'! |
1 | 69 |
|
4411
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
70 |
fromSeconds:secondsSinceMidnight |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
71 |
"return a new Time, which represents the number of seconds since midNight. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
72 |
Be careful, time wraps - if the number of seconds exceeds the number of seconds |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
73 |
in a day, a time relative to another days midnight is returned. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
74 |
(i.e. (Time fromSeconds:0) = (Time fromSeconds:24*3600)" |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
75 |
|
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
76 |
|s| |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
77 |
|
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
78 |
s := secondsSinceMidnight \\ (3600 * 24). |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
79 |
^ self |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
80 |
hours:(s // 3600) |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
81 |
minutes:((s \\ 3600) // 60) |
4883 | 82 |
seconds:((s \\ 3600) \\ 60) |
4411
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
83 |
|
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
84 |
" |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
85 |
Time fromSeconds:0 |
4883 | 86 |
Time fromSeconds:3675 |
4411
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
87 |
Time fromSeconds:36000 |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
88 |
Time fromSeconds:72000 |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
89 |
Time fromSeconds:96000 |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
90 |
" |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
91 |
|
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
92 |
"Modified: 8.10.1996 / 19:32:11 / cg" |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
93 |
|
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
94 |
|
4883 | 95 |
|
4411
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
96 |
! |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
97 |
|
239 | 98 |
hour:h minutes:m seconds:s |
1228 | 99 |
"return an instance of Time representing the given time. |
4031 | 100 |
See also Time now / Date today / AbsoluteTime now. |
101 |
Obsolete: please use #hours:minutes:seconds:" |
|
239 | 102 |
|
4031 | 103 |
self obsoleteMethodWarning:'use hours:minutes:seconds:'. |
104 |
||
105 |
^ self hours:h minutes:m seconds:s |
|
1 | 106 |
|
239 | 107 |
" |
4031 | 108 |
Time hours:2 minutes:33 seconds:0 |
109 |
Time hours:0 minutes:0 seconds:0 |
|
110 |
Time hours:24 minutes:0 seconds:0 |
|
111 |
Time hours23 minutes:59 seconds:59 |
|
112 |
" |
|
113 |
||
114 |
"Modified: 19.4.1996 / 15:32:40 / cg" |
|
115 |
! |
|
116 |
||
117 |
hours:h minutes:m seconds:s |
|
118 |
"return an instance of Time representing the given time. |
|
119 |
See also Time now / Date today / AbsoluteTime now." |
|
120 |
||
121 |
^ self basicNew setHours:h minutes:m seconds:s |
|
122 |
||
123 |
" |
|
124 |
Time hours:2 minutes:33 seconds:0 |
|
125 |
Time hours:0 minutes:0 seconds:0 |
|
126 |
Time hours:24 minutes:0 seconds:0 |
|
127 |
Time hours:23 minutes:59 seconds:59 |
|
95 | 128 |
" |
1228 | 129 |
|
130 |
"Modified: 19.4.1996 / 15:32:40 / cg" |
|
77 | 131 |
! |
132 |
||
569
7134eb78cf48
readFrom:onError: can now also read from a string
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
133 |
readFrom:aStringOrStream onError:exceptionBlock |
241 | 134 |
"return a new Time, reading a printed representation from aStream. |
3481
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
135 |
If no am/pm follows the time, the string is interpreted as |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
136 |
either 24 hour format or being am." |
239 | 137 |
|
3995
777470826394
no need for another error-handler blcok in #readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
138 |
|newTime| |
777470826394
no need for another error-handler blcok in #readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
139 |
|
1701
80d13adb2e77
better errorHandling in readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
140 |
ErrorSignal handle:[:ex | |
80d13adb2e77
better errorHandling in readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
141 |
^ exceptionBlock value |
80d13adb2e77
better errorHandling in readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
142 |
] do:[ |
3995
777470826394
no need for another error-handler blcok in #readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
143 |
|str hour min sec| |
216 | 144 |
|
1701
80d13adb2e77
better errorHandling in readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
145 |
str := aStringOrStream readStream. |
80d13adb2e77
better errorHandling in readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
146 |
|
3995
777470826394
no need for another error-handler blcok in #readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
147 |
hour := Integer readFrom:str. |
777470826394
no need for another error-handler blcok in #readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
148 |
(hour between:0 and:24) ifFalse:[^ exceptionBlock value]. |
275 | 149 |
|
3481
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
150 |
min := 0. |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
151 |
sec := 0. |
3477 | 152 |
str atEnd ifFalse:[ |
3481
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
153 |
(str peek == $:) ifTrue:[ |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
154 |
str next. |
3995
777470826394
no need for another error-handler blcok in #readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
155 |
min := Integer readFrom:str. |
777470826394
no need for another error-handler blcok in #readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
156 |
(min between:0 and:59) ifFalse:[^ exceptionBlock value]. |
275 | 157 |
|
3481
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
158 |
(str peek == $:) ifTrue:[ |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
159 |
str next. |
3995
777470826394
no need for another error-handler blcok in #readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
160 |
sec := Integer readFrom:str. |
777470826394
no need for another error-handler blcok in #readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
161 |
(sec between:0 and:59) ifFalse:[^ exceptionBlock value]. |
3481
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
162 |
]. |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
163 |
]. |
3477 | 164 |
[str peek == Character space] whileTrue:[str next]. |
3481
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
165 |
(str peek == $p or:[str peek == $P]) ifTrue:[ |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
166 |
str next. |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
167 |
(str peek == $m or:[str peek == $M]) ifTrue:[ |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
168 |
str next |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
169 |
]. |
3995
777470826394
no need for another error-handler blcok in #readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
170 |
(hour <= 0 or:[hour > 12]) ifTrue:[^ exceptionBlock value]. |
3478 | 171 |
|
3477 | 172 |
"pm" |
3478 | 173 |
hour ~~ 12 ifTrue:[ |
174 |
hour := hour + 12 |
|
175 |
] |
|
176 |
] ifFalse:[ |
|
3481
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
177 |
(str peek == $a or:[str peek == $A]) ifTrue:[ |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
178 |
str next. |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
179 |
(str peek == $m or:[str peek == $M]) ifTrue:[ |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
180 |
str next |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
181 |
]. |
3995
777470826394
no need for another error-handler blcok in #readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
182 |
hour >= 12 ifTrue:[^ exceptionBlock value]. |
3478 | 183 |
hour == 24 ifTrue:[ |
184 |
hour := 0. |
|
185 |
] |
|
186 |
] |
|
187 |
] |
|
1701
80d13adb2e77
better errorHandling in readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
188 |
]. |
4031 | 189 |
newTime := self basicNew setHours:hour minutes:min seconds:sec |
3995
777470826394
no need for another error-handler blcok in #readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
190 |
]. |
777470826394
no need for another error-handler blcok in #readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
191 |
^ newTime |
216 | 192 |
|
239 | 193 |
" |
3481
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
194 |
Time readFrom:'0:00' |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
195 |
Time readFrom:'2:00' |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
196 |
Time readFrom:'12:00' |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
197 |
Time readFrom:'14:00' |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
198 |
Time readFrom:'23:00' |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
199 |
Time readFrom:'24:00' |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
200 |
Time readFrom:'2:30 am' |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
201 |
Time readFrom:'2:30 pm' |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
202 |
Time readFrom:'14' |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
203 |
Time readFrom:'2 am' |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
204 |
Time readFrom:'2 pm' |
1da093bda862
allow reading of times without secs/minutes.
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
205 |
|
409 | 206 |
Time readFrom:'18:22:00' |
207 |
Time readFrom:'14:00:11' |
|
208 |
Time readFrom:'7:00:11' |
|
3478 | 209 |
Time readFrom:'24:00:00' |
210 |
Time readFrom:'0:00:00' |
|
211 |
Time readFrom:'12:00:00' |
|
212 |
Time readFrom:'0:00:00' |
|
409 | 213 |
Time readFrom:'6:22:00 pm' |
214 |
Time readFrom:'2:00:11 pm' |
|
215 |
Time readFrom:'7:00:11 am' |
|
3478 | 216 |
Time readFrom:'12:00:00 am' |
217 |
Time readFrom:'0:00:00 am' |
|
218 |
Time readFrom:'24:00:00 am' |
|
219 |
Time readFrom:'12:00:00 pm' |
|
220 |
Time readFrom:'0:00:00 pm' - invalid |
|
221 |
Time readFrom:'24:00:00 pm' |
|
239 | 222 |
" |
569
7134eb78cf48
readFrom:onError: can now also read from a string
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
223 |
|
1701
80d13adb2e77
better errorHandling in readFrom:onError:
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
224 |
"Modified: 8.10.1996 / 19:32:11 / cg" |
1 | 225 |
! ! |
226 |
||
4411
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
227 |
!Time class methodsFor:'format strings'! |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
228 |
|
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
229 |
formatString12us |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
230 |
"return the format string used to format US times (and other areas)" |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
231 |
|
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
232 |
^ '%u:%m:%s %a' |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
233 |
! |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
234 |
|
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
235 |
formatString24 |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
236 |
"return the format string used to format european times (and other areas)" |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
237 |
|
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
238 |
^ '%h:%m:%s' |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
239 |
! ! |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
240 |
|
4412 | 241 |
!Time methodsFor:'Compatibility - Squeak'! |
242 |
||
243 |
intervalString |
|
244 |
"Treat the time as a difference. |
|
245 |
Give it in hours and minutes with two digits of accuracy." |
|
246 |
||
247 |
|hours minutes seconds hh mm ss | |
|
248 |
||
249 |
hours := self hours. |
|
250 |
minutes := self minutes. |
|
251 |
seconds := self seconds. |
|
252 |
hh := hours = 0 ifTrue: [''] ifFalse: [' ', hours printString, ' hours']. |
|
253 |
mm := minutes = 0 ifTrue: [''] ifFalse: [' ', minutes printString, ' minutes']. |
|
254 |
ss := seconds = 0 ifTrue: [''] ifFalse: [' ', seconds printString, ' seconds']. |
|
255 |
hh size > 0 ifTrue: [ss := '']. |
|
256 |
^ hh, mm, ss |
|
257 |
||
258 |
" |
|
259 |
(Time fromSeconds:3600) intervalString |
|
260 |
(Time fromSeconds:3605) intervalString |
|
261 |
(Time fromSeconds:5) intervalString |
|
262 |
(Time fromSeconds:65) intervalString |
|
263 |
" |
|
4999 | 264 |
! |
265 |
||
266 |
print24:prnt24Format showSeconds:doSeconds on:aStream |
|
267 |
"print me either US or 24hr format, optionally with |
|
268 |
seconds on a stream" |
|
269 |
||
270 |
|format| |
|
271 |
||
272 |
prnt24Format ifTrue:[ |
|
273 |
doSeconds ifTrue:[ |
|
274 |
format := '%h:%m:%s' |
|
275 |
] ifFalse:[ |
|
276 |
format := '%h:%m' |
|
277 |
]. |
|
278 |
] ifFalse:[ |
|
279 |
"/ US format |
|
280 |
doSeconds ifTrue:[ |
|
281 |
format := '%u:%m:%s %a' |
|
282 |
] ifFalse:[ |
|
283 |
format := '%u:%m %a' |
|
284 |
]. |
|
285 |
]. |
|
286 |
^ self |
|
287 |
printOn:aStream |
|
288 |
format:format. |
|
289 |
||
290 |
" |
|
291 |
Time now print24:true showSeconds:true on:Transcript. Transcript cr. |
|
292 |
Time now print24:false showSeconds:true on:Transcript. Transcript cr. |
|
293 |
Time now print24:true showSeconds:false on:Transcript. Transcript cr. |
|
294 |
Time now print24:false showSeconds:false on:Transcript. Transcript cr. |
|
295 |
" |
|
4412 | 296 |
! ! |
297 |
||
95 | 298 |
!Time methodsFor:'accessing'! |
77 | 299 |
|
699 | 300 |
day |
301 |
"catch day access - Time does not know about it" |
|
77 | 302 |
|
699 | 303 |
^ self shouldNotImplement |
1 | 304 |
! |
305 |
||
241 | 306 |
hours |
307 |
"return the number of hours since midnight (i.e. 0..23)" |
|
95 | 308 |
|
241 | 309 |
^ timeEncoding // 3600 |
310 |
||
311 |
" |
|
312 |
Time now hours |
|
313 |
" |
|
275 | 314 |
! |
315 |
||
4845 | 316 |
milliseconds |
317 |
"time does not keep milliseconds |
|
318 |
- for compatibility with absoluteTime" |
|
319 |
||
320 |
^ 0 |
|
321 |
! |
|
322 |
||
699 | 323 |
minutes |
324 |
"return the number of minutes within the hour (i.e. 0..59)" |
|
275 | 325 |
|
699 | 326 |
^ (timeEncoding \\ 3600) // 60 |
327 |
||
328 |
" |
|
329 |
Time now minutes |
|
330 |
" |
|
275 | 331 |
! |
332 |
||
333 |
month |
|
334 |
"catch month access - Time does not know about it" |
|
335 |
||
336 |
^ self shouldNotImplement |
|
337 |
! |
|
338 |
||
699 | 339 |
seconds |
340 |
"return the number of seconds within the minute (i.e. 0..59)" |
|
341 |
||
342 |
^ (timeEncoding \\ 3600) \\ 60 |
|
343 |
||
344 |
" |
|
345 |
Time now seconds |
|
346 |
" |
|
347 |
! |
|
348 |
||
275 | 349 |
year |
350 |
"catch year access - Time does not know about it" |
|
351 |
||
352 |
^ self shouldNotImplement |
|
1 | 353 |
! ! |
354 |
||
699 | 355 |
!Time methodsFor:'comparing'! |
356 |
||
357 |
< aTime |
|
358 |
"return true if the argument, aTime is before the receiver" |
|
359 |
||
360 |
^ timeEncoding < aTime timeEncoding |
|
361 |
! |
|
1 | 362 |
|
699 | 363 |
= aTime |
364 |
"return true if the argument, aTime represents the same timeOfDay" |
|
365 |
||
366 |
aTime class == self class ifTrue:[ |
|
367 |
^ timeEncoding == aTime timeEncoding |
|
368 |
]. |
|
369 |
(aTime species == self species) ifFalse:[^ false]. |
|
370 |
^ self asSeconds == aTime asSeconds |
|
371 |
! |
|
372 |
||
373 |
> aTime |
|
374 |
"return true if the argument, aTime is after the receiver" |
|
95 | 375 |
|
699 | 376 |
^ timeEncoding > aTime timeEncoding |
377 |
! |
|
378 |
||
379 |
hash |
|
380 |
"return an integer useful for hashing on times" |
|
381 |
||
382 |
^ timeEncoding |
|
383 |
! ! |
|
384 |
||
385 |
!Time methodsFor:'converting'! |
|
95 | 386 |
|
699 | 387 |
asAbsoluteTime |
388 |
"return an AbsoluteTime object from the receiver. |
|
389 |
The date components are taken from today." |
|
390 |
||
391 |
|today| |
|
392 |
||
393 |
today := Date today. |
|
4379 | 394 |
^ AbsoluteTime year:today year month:today month day:today day |
395 |
hour:self hours minute:self minutes second:self seconds |
|
95 | 396 |
" |
699 | 397 |
Time now asAbsoluteTime |
95 | 398 |
" |
4379 | 399 |
|
400 |
"Modified: / 13.7.1999 / 12:32:08 / stefan" |
|
62 | 401 |
! |
402 |
||
699 | 403 |
asSeconds |
404 |
"return the number of seconds elapsed since midnight" |
|
1 | 405 |
|
699 | 406 |
^ timeEncoding |
95 | 407 |
|
408 |
" |
|
699 | 409 |
Time now asSeconds |
95 | 410 |
" |
411 |
! |
|
412 |
||
699 | 413 |
asTime |
414 |
"return a Time object from the receiver - thats the receiver." |
|
415 |
||
416 |
^ self |
|
417 |
! ! |
|
418 |
||
419 |
!Time methodsFor:'printing & storing'! |
|
420 |
||
95 | 421 |
print12HourFormatOn:aStream |
422 |
"append a printed representation of the receiver to aStream. |
|
241 | 423 |
Format is hh:mm:ss am/pm (i.e. 12-hour american format)." |
95 | 424 |
|
4411
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
425 |
^ self |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
426 |
printOn:aStream |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
427 |
format:(self class formatString12us) |
3478 | 428 |
|
4411
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
429 |
"/ |h m s ampm| |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
430 |
"/ |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
431 |
"/ h := self hours. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
432 |
"/ |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
433 |
"/ "/ 0 -> 12 am |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
434 |
"/ "/ 12 -> 12 pm |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
435 |
"/ |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
436 |
"/ h // 12 == 0 ifTrue:[ |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
437 |
"/ ampm := ' am'. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
438 |
"/ ] ifFalse:[ |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
439 |
"/ ampm := ' pm'. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
440 |
"/ ]. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
441 |
"/ |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
442 |
"/ h == 0 ifFalse:[ |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
443 |
"/ h := h - 1 \\ 12 + 1. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
444 |
"/ ]. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
445 |
"/ |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
446 |
"/ h printOn:aStream. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
447 |
"/ aStream nextPut:$:. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
448 |
"/ m := self minutes. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
449 |
"/ (m < 10) ifTrue:[aStream nextPut:$0]. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
450 |
"/ m printOn:aStream. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
451 |
"/ aStream nextPut:$:. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
452 |
"/ s := self seconds. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
453 |
"/ (s < 10) ifTrue:[aStream nextPut:$0]. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
454 |
"/ s printOn:aStream. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
455 |
"/ aStream nextPutAll:ampm |
95 | 456 |
|
457 |
" |
|
216 | 458 |
Time now print12HourFormatOn:Transcript. Transcript cr |
3477 | 459 |
(Time now subtractHours:12) print12HourFormatOn:Transcript. Transcript cr |
460 |
(Time hour:24 minutes:0 seconds:0) print12HourFormatOn:Transcript. Transcript cr |
|
461 |
(Time hour:12 minutes:0 seconds:0) print12HourFormatOn:Transcript. Transcript cr |
|
462 |
(Time hour:0 minutes:0 seconds:0) print12HourFormatOn:Transcript. Transcript cr |
|
3478 | 463 |
0 to:24 do:[:h | |
464 |
(Time hour:h minutes:0 seconds:0) print12HourFormatOn:Transcript. Transcript cr |
|
465 |
] |
|
95 | 466 |
" |
699 | 467 |
! |
241 | 468 |
|
699 | 469 |
print24HourFormatOn:aStream |
470 |
"append a printed representation of the receiver to aStream. |
|
471 |
Format is hh:mm:ss (i.e. 24-hour european format)." |
|
472 |
||
4411
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
473 |
^ self |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
474 |
printOn:aStream |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
475 |
format:(self class formatString24). |
241 | 476 |
|
4411
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
477 |
"/ |h m s| |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
478 |
"/ |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
479 |
"/ h := self hours. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
480 |
"/ (h < 10) ifTrue:[aStream nextPut:$0]. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
481 |
"/ h printOn:aStream. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
482 |
"/ aStream nextPut:$:. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
483 |
"/ m := self minutes. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
484 |
"/ (m < 10) ifTrue:[aStream nextPut:$0]. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
485 |
"/ m printOn:aStream. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
486 |
"/ aStream nextPut:$:. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
487 |
"/ s := self seconds. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
488 |
"/ (s < 10) ifTrue:[aStream nextPut:$0]. |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
489 |
"/ s printOn:aStream |
241 | 490 |
|
491 |
" |
|
699 | 492 |
Time now print24HourFormatOn:Transcript. Transcript cr |
241 | 493 |
" |
275 | 494 |
! |
495 |
||
699 | 496 |
printOn:aStream |
4392 | 497 |
"append a user printed representation of the receiver to aStream. |
498 |
The format is suitable for a human - not meant to be read back. |
|
499 |
||
699 | 500 |
Format is hh:mm:ss either in 12-hour or 24-hour format. |
501 |
depending on the setting of LanguageTerritory. |
|
502 |
I dont know what ST-80 does here (12-hour format ?)" |
|
241 | 503 |
|
993
feaa62827c41
check for territory being #us (instead of #usa) when printing
Claus Gittinger <cg@exept.de>
parents:
699
diff
changeset
|
504 |
LanguageTerritory == #us ifTrue:[ |
feaa62827c41
check for territory being #us (instead of #usa) when printing
Claus Gittinger <cg@exept.de>
parents:
699
diff
changeset
|
505 |
self print12HourFormatOn:aStream |
699 | 506 |
] ifFalse:[ |
993
feaa62827c41
check for territory being #us (instead of #usa) when printing
Claus Gittinger <cg@exept.de>
parents:
699
diff
changeset
|
507 |
self print24HourFormatOn:aStream |
699 | 508 |
] |
275 | 509 |
|
699 | 510 |
" |
511 |
Time now printOn:Transcript. Transcript cr |
|
512 |
" |
|
993
feaa62827c41
check for territory being #us (instead of #usa) when printing
Claus Gittinger <cg@exept.de>
parents:
699
diff
changeset
|
513 |
|
feaa62827c41
check for territory being #us (instead of #usa) when printing
Claus Gittinger <cg@exept.de>
parents:
699
diff
changeset
|
514 |
"Modified: 22.2.1996 / 16:58:30 / cg" |
2706
878723bc99fc
added #shortPrintString for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1701
diff
changeset
|
515 |
! |
878723bc99fc
added #shortPrintString for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1701
diff
changeset
|
516 |
|
3709 | 517 |
printString12HourFormat |
518 |
"return a printed representation in 12 hour format" |
|
519 |
||
4411
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
520 |
^ self printStringFormat:(self class formatString12us) |
3709 | 521 |
|
4411
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
522 |
" |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
523 |
Time now printString12HourFormat |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
524 |
" |
3709 | 525 |
! |
526 |
||
527 |
printString24HourFormat |
|
528 |
"return a printed representation in 24 hour format" |
|
529 |
||
4411
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
530 |
^ self printStringFormat:(self class formatString24) |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
531 |
|
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
532 |
" |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
533 |
Time now printString24HourFormat |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
534 |
" |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
535 |
|
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
536 |
! |
684a2b944463
much improved formatting (see #printOn:format:)
Claus Gittinger <cg@exept.de>
parents:
4392
diff
changeset
|
537 |
|
2706
878723bc99fc
added #shortPrintString for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1701
diff
changeset
|
538 |
shortPrintString |
878723bc99fc
added #shortPrintString for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1701
diff
changeset
|
539 |
"dummy - for now" |
878723bc99fc
added #shortPrintString for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1701
diff
changeset
|
540 |
|
878723bc99fc
added #shortPrintString for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1701
diff
changeset
|
541 |
^ self printString |
878723bc99fc
added #shortPrintString for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1701
diff
changeset
|
542 |
|
878723bc99fc
added #shortPrintString for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1701
diff
changeset
|
543 |
"Created: 20.6.1997 / 17:17:01 / cg" |
241 | 544 |
! ! |
545 |
||
546 |
!Time methodsFor:'private'! |
|
547 |
||
1502 | 548 |
fromOSTime:osTime |
549 |
"set my time, given an osTime" |
|
275 | 550 |
|
551 |
|h m s| |
|
1502 | 552 |
|
553 |
OperatingSystem computeTimePartsOf:osTime for:[ |
|
554 |
:hours :minutes :secs :millis | |
|
275 | 555 |
|
1502 | 556 |
h := hours. |
557 |
m := minutes. |
|
558 |
s := secs. |
|
275 | 559 |
]. |
4031 | 560 |
self setHours:h minutes:m seconds:s |
275 | 561 |
|
1502 | 562 |
"Modified: 1.7.1996 / 15:21:06 / cg" |
275 | 563 |
! |
564 |
||
3477 | 565 |
getMilliseconds |
566 |
^ self getSeconds * 1000 |
|
567 |
! |
|
568 |
||
275 | 569 |
getSeconds |
570 |
^ timeEncoding |
|
571 |
! |
|
572 |
||
4031 | 573 |
setHours:h minutes:m seconds:s |
699 | 574 |
"set my time given individual values" |
575 |
||
3477 | 576 |
self setSeconds:(((h\\24) * 60 * 60 ) + (m * 60) + s). |
577 |
! |
|
578 |
||
579 |
setMilliseconds:millis |
|
580 |
"set my time given milliseconds since midnight" |
|
581 |
||
582 |
self setSeconds:(millis // 1000) |
|
699 | 583 |
! |
584 |
||
275 | 585 |
setSeconds:secs |
586 |
"set my time given seconds since midnight" |
|
587 |
||
3477 | 588 |
secs < 0 ifTrue:[ |
589 |
timeEncoding := (24 * 3600) - (secs negated \\ (24 * 3600)) |
|
590 |
] ifFalse:[ |
|
591 |
timeEncoding := secs |
|
592 |
] |
|
275 | 593 |
! |
594 |
||
699 | 595 |
timeEncoding |
596 |
"the internal encoding is stricktly private, |
|
597 |
and should not be used outside." |
|
275 | 598 |
|
699 | 599 |
^ timeEncoding |
275 | 600 |
! |
601 |
||
241 | 602 |
timeEncoding:encoding |
603 |
"the internal encoding is stricktly private, |
|
604 |
and should not be used outside." |
|
605 |
||
606 |
timeEncoding := encoding |
|
699 | 607 |
! ! |
608 |
||
2706
878723bc99fc
added #shortPrintString for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1701
diff
changeset
|
609 |
!Time class methodsFor:'documentation'! |
241 | 610 |
|
699 | 611 |
version |
4999 | 612 |
^ '$Header: /cvs/stx/stx/libbasic/Time.st,v 1.45 1999-11-18 14:19:16 cg Exp $' |
241 | 613 |
! ! |