Skip to content

Commit bcded1d

Browse files
author
Johan Brichau
committed
Merge branch 'master' into gemstone
* master: Update README.md sync with upstream, #stable v17 sync with v1.6 resync with upstream stable v16 Conflicts: repository/ZTimestamp.package/DateAndTime.extension/instance/asZTimestamp.st repository/ZTimestamp.package/DateAndTime.extension/methodProperties.json repository/ZTimestamp.package/ZTimestampFormat.class/instance/format.timeZoneOn..st repository/ZTimestamp.package/ZTimestampFormatTests.class/methodProperties.json repository/ZTimestamp.package/ZTimestampTests.class/instance/testConversions.st repository/ZTimestamp.package/ZTimestampTests.class/methodProperties.json
2 parents 2de0f8d + 82b068e commit bcded1d

File tree

148 files changed

+1112
-71
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+1112
-71
lines changed

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.package/monticello.meta/version merge=mcVersion
2+
*.package/*.class/methodProperties.json merge=mcMethodProperties
3+
*.package/*.class/properties.json merge=mcProperties
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
catalog
2+
catalogChangeLog
3+
"Returns a paragraph describing the most important changes in the configuration class."
4+
^ 'Started April 2012 with core ZTimestamp as alternative to DateAndTime/Timestamp. Added ZTimestampFormat to format/parse by example in November 2012. Added SNTP client in February 2013. Added ZTimezone support in March 2014'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
catalog
2+
catalogContactInfo
3+
"Returns a paragraph describing contact information such as email, mailing lists and website."
4+
^ 'Written and maintained by Sven Van Caekenberghe (http://stfx.eu). Discussions on the Pharo aling lists. Documentation can be found at https://github.com/svenvc/docs/blob/master/neo/ztimestamp.md'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
catalog
2+
catalogDescription
3+
"Returns a paragraph describing the project"
4+
^ 'The ZTimestamp project groups a number of classes that form an addition/alternative to DateAndTime/Timestamp. The core ZTimestamp class represents a point in time, with second precision and always in the UTC/GTM/Zulu timezone. It is faster and smaller. ZTimestampFormat is a formatter and parser that is example based. ZTimezone uses the standard Olsone timezone database to compute the offset for local time at specific points in time for a specified timezone. ZTimestampSNTPClient is an SNTP client to check the local clock against network time servers. This project is small and has no further dependencies. It runs in Pharo 2 and 3.'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
catalog
2+
catalogKeyClassesAndExample
3+
"Returns a paragraph or more describing the key classes of your project. You can use Pillar/Pier syntax to layout out the text i.e., ==Code== and - for bullet."
4+
^ 'The core classes are ZTimestamp to represent a point in time, ZTimestampFormat to format and parse chronology objects by example, ZTimezone to compute local time offsets and ZTimestampSNTPClient to check the clock against an network time server.'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
catalog
2+
catalogKeywords
3+
"Returns an array of symbols"
4+
^ #(timestamp time date chronology parsing formatting timezone sntp)

repository/ConfigurationOfZTimestamp.package/ConfigurationOfZTimestamp.class/instance/stable..st

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ symbolic versions
22
stable: spec
33
<symbolicVersion: #'stable'>
44

5-
spec for: #common version: '14'
5+
spec for: #common version: '17'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
versions
2+
version15: spec
3+
<version: '15' imports: #('1-baseline')>
4+
5+
spec for: #common do: [
6+
spec
7+
blessing: #release;
8+
package: 'ZTimestamp' with: 'ZTimestamp-SvenVanCaekenberghe.34' ]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
versions
2+
version16: spec
3+
<version: '16' imports: #('1-baseline')>
4+
5+
spec for: #common do: [
6+
spec
7+
blessing: #release;
8+
package: 'ZTimestamp' with: 'ZTimestamp-SvenVanCaekenberghe.43' ]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
versions
2+
version17: spec
3+
<version: '17' imports: #('1-baseline')>
4+
5+
spec for: #common do: [
6+
spec
7+
blessing: #release;
8+
package: 'ZTimestamp' with: 'ZTimestamp-SvenVanCaekenberghe.47' ]

repository/ConfigurationOfZTimestamp.package/ConfigurationOfZTimestamp.class/methodProperties.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
"class" : {
33
"DevelopmentSupport" : "SvenVanCaekenberghe 6/22/2012 14:57",
44
"baseConfigurationClassIfAbsent:" : "SvenVanCaekenberghe 6/22/2012 14:57",
5+
"catalogChangeLog" : "SvenVanCaekenberghe 3/12/2014 13:36",
6+
"catalogContactInfo" : "SvenVanCaekenberghe 3/12/2014 13:29",
7+
"catalogDescription" : "SvenVanCaekenberghe 3/12/2014 13:46",
8+
"catalogKeyClassesAndExample" : "SvenVanCaekenberghe 3/12/2014 13:26",
9+
"catalogKeywords" : "SvenVanCaekenberghe 3/12/2014 13:27",
510
"ensureMetacello" : "SvenVanCaekenberghe 6/22/2012 14:57",
611
"ensureMetacelloBaseConfiguration" : "SvenVanCaekenberghe 6/22/2012 14:57",
712
"isMetacelloConfig" : "SvenVanCaekenberghe 6/22/2012 14:57",
@@ -13,12 +18,15 @@
1318
"instance" : {
1419
"baseline1:" : "SvenVanCaekenberghe 6/22/2012 15:10",
1520
"project" : "SvenVanCaekenberghe 6/22/2012 14:57",
16-
"stable:" : "SvenVanCaekenberghe 2/1/2014 17:20",
21+
"stable:" : "SvenVanCaekenberghe 4/24/2014 13:01",
1722
"version10:" : "SvenVanCaekenberghe 5/31/2013 09:40",
1823
"version11:" : "SvenVanCaekenberghe 6/21/2013 21:09",
1924
"version12:" : "SvenVanCaekenberghe 6/27/2013 14:11",
2025
"version13:" : "SvenVanCaekenberghe 2/1/2014 13:28",
2126
"version14:" : "SvenVanCaekenberghe 2/1/2014 17:19",
27+
"version15:" : "SvenVanCaekenberghe 2/12/2014 14:58",
28+
"version16:" : "SvenVanCaekenberghe 3/16/2014 20:26",
29+
"version17:" : "SvenVanCaekenberghe 4/24/2014 13:01",
2230
"version1:" : "SvenVanCaekenberghe 9/27/2012 20:14",
2331
"version2:" : "SvenVanCaekenberghe 9/27/2012 20:14",
2432
"version3:" : "SvenVanCaekenberghe 9/27/2012 20:14",

repository/ConfigurationOfZTimestamp.package/monticello.meta/version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.18' message 'stable v14' id 'd72f8c0e-77ac-4f4c-b91b-3e39450be08c' date '1 February 2014' time '5:23:40.98789 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.17' message 'stable v13' id '3f8df516-7b4a-4aec-a01f-1aa4642465f4' date '1 February 2014' time '1:29:32.288137 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.16' message 'updated to v12' id 'aaf58cae-18f4-459e-848a-ae95310fcbe8' date '27 June 2013' time '2:12:25.727 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.15' message 'v11' id 'c3b7916a-9dbe-4918-a8c5-25ba805e180d' date '21 June 2013' time '9:09:19.014 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.14' message 'v10' id 'c673cc59-c17a-4906-930e-e7d9b000c72e' date '31 May 2013' time '9:40:24.63 am' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.13' message 'stable version 9 (ported to Pharo 3.0)' id 'addc01fc-a57f-4376-9a74-3175027f23cf' date '29 May 2013' time '5:23:57.595657 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.12' message 'stable version 8' id 'ad49b1cb-a7f0-493a-8f85-fc0a920c3ee6' date '19 December 2012' time '1:53:42.014 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.11' message 'stable version 7' id '0eb6aee2-0962-418a-a544-89c48f374b19' date '18 December 2012' time '10:24:56.53 am' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.10' message 'updated' id 'eeb85f8b-6f8c-4897-91cd-2e753ef5ebff' date '5 November 2012' time '9:25:50.291 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.9' message 'added ZTimestampFormat' id 'e912badd-008a-4666-b325-f40492bc6925' date '5 November 2012' time '8:09:02.902 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.8' message 'and updated #stable as well' id '81f989e4-7442-47da-9f63-20acd02d5c49' date '12 October 2012' time '1:19:18.209 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.7' message 'updated to version 4' id 'c6b64b71-da73-47e7-b154-e7d763f9a5a9' date '12 October 2012' time '1:17:10.939 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.6' message 'added spec blessing: #release to all versiosn' id '449b5318-8852-4ab5-aaa1-7ca4ed470628' date '27 September 2012' time '8:26:06.574 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.5' message 'updated' id 'e0f8033d-9013-4d6e-ba0e-946e958fd684' date '3 September 2012' time '8:13:52.611 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.4' message 'forgot to bump the stable version' id '9f8d696f-465a-4434-b0d6-3a9e9539bb30' date '6 July 2012' time '8:52:28.312 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.3' message 'added ZTimestamp>>#asBeginOfDay and #asEndOfDayextended ZTimestamp class>>#readFrom: to accept a 14-digit format without separators' id '18136b6e-1588-4637-b4d0-a7877add82fe' date '6 July 2012' time '5:36:02.914 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.2' message 'fixed #version1:' id '99a7e06a-4fe9-48d8-8b32-01a9d496fe33' date '22 June 2012' time '3:50:02.856 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.1' message '1st config version in Neo repo' id '3e180ac4-884b-4ca4-b372-684c040d73da' date '22 June 2012' time '3:28:42.142 pm' author 'SvenVanCaekenberghe' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
1+
(name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.22' message 'updated to #stable v17' id '701cc22a-38d6-4a21-a1b1-84a427017665' date '24 April 2014' time '1:02:41.528665 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.21' message 'stable v16' id 'a3ff2cbf-419e-49aa-947b-addbaa41a882' date '16 March 2014' time '8:28:03.997786 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.20' message 'Added catalog methods' id '5bb6ca57-9d1a-49c6-a1c0-08d3dbc70bb9' date '12 March 2014' time '1:47:20.901381 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.19' message 'stable v15' id 'ea25a565-889b-4582-b503-bc2b8f014ec7' date '12 February 2014' time '2:58:45.594057 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.18' message 'stable v14' id 'd72f8c0e-77ac-4f4c-b91b-3e39450be08c' date '1 February 2014' time '5:23:40.98789 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.17' message 'stable v13' id '3f8df516-7b4a-4aec-a01f-1aa4642465f4' date '1 February 2014' time '1:29:32.288137 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.16' message 'updated to v12' id 'aaf58cae-18f4-459e-848a-ae95310fcbe8' date '27 June 2013' time '2:12:25.727 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.15' message 'v11' id 'c3b7916a-9dbe-4918-a8c5-25ba805e180d' date '21 June 2013' time '9:09:19.014 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.14' message 'v10' id 'c673cc59-c17a-4906-930e-e7d9b000c72e' date '31 May 2013' time '9:40:24.63 am' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.13' message 'stable version 9 (ported to Pharo 3.0)' id 'addc01fc-a57f-4376-9a74-3175027f23cf' date '29 May 2013' time '5:23:57.595657 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.12' message 'stable version 8' id 'ad49b1cb-a7f0-493a-8f85-fc0a920c3ee6' date '19 December 2012' time '1:53:42.014 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.11' message 'stable version 7' id '0eb6aee2-0962-418a-a544-89c48f374b19' date '18 December 2012' time '10:24:56.53 am' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.10' message 'updated' id 'eeb85f8b-6f8c-4897-91cd-2e753ef5ebff' date '5 November 2012' time '9:25:50.291 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.9' message 'added ZTimestampFormat' id 'e912badd-008a-4666-b325-f40492bc6925' date '5 November 2012' time '8:09:02.902 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.8' message 'and updated #stable as well' id '81f989e4-7442-47da-9f63-20acd02d5c49' date '12 October 2012' time '1:19:18.209 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.7' message 'updated to version 4' id 'c6b64b71-da73-47e7-b154-e7d763f9a5a9' date '12 October 2012' time '1:17:10.939 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.6' message 'added spec blessing: #release to all versiosn' id '449b5318-8852-4ab5-aaa1-7ca4ed470628' date '27 September 2012' time '8:26:06.574 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.5' message 'updated' id 'e0f8033d-9013-4d6e-ba0e-946e958fd684' date '3 September 2012' time '8:13:52.611 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.4' message 'forgot to bump the stable version' id '9f8d696f-465a-4434-b0d6-3a9e9539bb30' date '6 July 2012' time '8:52:28.312 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.3' message 'added ZTimestamp>>#asBeginOfDay and #asEndOfDayextended ZTimestamp class>>#readFrom: to accept a 14-digit format without separators' id '18136b6e-1588-4637-b4d0-a7877add82fe' date '6 July 2012' time '5:36:02.914 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.2' message 'fixed #version1:' id '99a7e06a-4fe9-48d8-8b32-01a9d496fe33' date '22 June 2012' time '3:50:02.856 pm' author 'SvenVanCaekenberghe' ancestors ((name 'ConfigurationOfZTimestamp-SvenVanCaekenberghe.1' message '1st config version in Neo repo' id '3e180ac4-884b-4ca4-b372-684c040d73da' date '22 June 2012' time '3:28:42.142 pm' author 'SvenVanCaekenberghe' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
*ztimestamp
22
asZTimestamp
3+
"Convert the receiver to a ZTimestamp.
4+
Note that we are implicitly converting to UTC by ignoring the offset.
5+
Note also that nano seconds are dropped."
6+
37
^ ZTimestamp new
4-
jdn: self julianDayNumber
5-
secs: self secondsSinceMidnight rounded asInteger - offset
8+
jdn: julianDayNumber
9+
secs: seconds
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*ztimestamp
2+
subtractFromTimestamp: timestamp
3+
"Part of the double dispatch implementation of ZTimestamp>>#-"
4+
5+
^ timestamp subtractTimestamp: self asZTimestamp

repository/ZTimestamp.package/DateAndTime.extension/methodProperties.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
"class" : {
33
},
44
"instance" : {
5-
"asZTimestamp" : "JohanBrichau 02/07/2014 14:58" } }
5+
"asZTimestamp" : "SvenVanCaekenberghe 3/29/2014 00:43",
6+
"subtractFromTimestamp:" : "SvenVanCaekenberghe 3/28/2014 17:08" } }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*ztimestamp
2+
subtractFromTimestamp: timestamp
3+
"Part of the double dispatch implementation of ZTimestamp>>#-"
4+
5+
^ timestamp subtractDuration: self
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"class" : {
3+
},
4+
"instance" : {
5+
"subtractFromTimestamp:" : "SvenVanCaekenberghe 3/28/2014 17:08" } }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{
2+
"name" : "Duration" }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
I am ZCurrentTimezone.
2+
I am a DynamicVariable.
3+
4+
I am used to hold the default timezone to use to render UTC/GMT/Zulu timestamps to local time representations.
5+
6+
I am also used to hold the default timezone to parse local time representations into UTC/GMT/Zulu timestamps.
7+
8+
Any object that responds to #offsetForTimestamp: can be a timezone.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"class" : {
3+
},
4+
"instance" : {
5+
} }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"category" : "ZTimestamp",
3+
"classinstvars" : [
4+
],
5+
"classvars" : [
6+
],
7+
"commentStamp" : "SvenVanCaekenberghe 3/12/2014 23:04",
8+
"instvars" : [
9+
],
10+
"name" : "ZCurrentTimezone",
11+
"pools" : [
12+
],
13+
"super" : "DynamicVariable",
14+
"type" : "normal" }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
I am ZSubTimezone.
2+
I represent a specific offset duration to be added to UTC.
3+
I am identified by an abbreviation.
4+
I know whether daylight saving time is in use or not.
5+
6+
See ZTimezone
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
instance creation
2+
abbreviation: string offset: integer dst: boolean
3+
^ self new
4+
abbreviation: string;
5+
offset: integer;
6+
isDaylightSaving: boolean;
7+
yourself
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
instance creation
2+
gmt
3+
^ self abbreviation: #GMT offset: 0 dst: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
accessing
2+
abbreviation: string
3+
abbreviation := string asSymbol
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
accessing
2+
abbreviation
3+
^ abbreviation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
accessing
2+
isDaylightSaving: boolean
3+
isDaylightSaving := boolean
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
accessing
2+
isDaylightSaving
3+
^ isDaylightSaving
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
accessing
2+
offset: integer
3+
offset := integer asDuration
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
accessing
2+
offset
3+
^ offset
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
printing
2+
printOn: stream
3+
super printOn: stream.
4+
stream nextPut: $(.
5+
stream << abbreviation; space; print: offset.
6+
isDaylightSaving ifTrue: [ stream << ' DST' ].
7+
stream nextPut: $)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"class" : {
3+
"abbreviation:offset:dst:" : "SvenVanCaekenberghe 3/11/2014 00:08",
4+
"gmt" : "SvenVanCaekenberghe 3/11/2014 13:23" },
5+
"instance" : {
6+
"abbreviation" : "SvenVanCaekenberghe 3/11/2014 00:07",
7+
"abbreviation:" : "SvenVanCaekenberghe 3/11/2014 10:24",
8+
"isDaylightSaving" : "SvenVanCaekenberghe 3/11/2014 00:07",
9+
"isDaylightSaving:" : "SvenVanCaekenberghe 3/11/2014 10:24",
10+
"offset" : "SvenVanCaekenberghe 3/11/2014 00:07",
11+
"offset:" : "SvenVanCaekenberghe 3/11/2014 10:25",
12+
"printOn:" : "SvenVanCaekenberghe 3/11/2014 00:12" } }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"category" : "ZTimestamp",
3+
"classinstvars" : [
4+
],
5+
"classvars" : [
6+
],
7+
"commentStamp" : "SvenVanCaekenberghe 3/12/2014 13:12",
8+
"instvars" : [
9+
"abbreviation",
10+
"offset",
11+
"isDaylightSaving" ],
12+
"name" : "ZSubTimezone",
13+
"pools" : [
14+
],
15+
"super" : "Object",
16+
"type" : "normal" }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
accessing
2+
withNowDo: block
3+
"Evaluate block with 2 arguments: ZTimestamp now and the residual microseconds.
4+
Return the value of block. Works only on Pharo 3.0 and higher."
5+
6+
"self withNowDo: [ :timestamp :microseconds | { timestamp. microseconds } ]"
7+
8+
| microsecondClockValue totalSeconds |
9+
microsecondClockValue := Time microsecondClockValue.
10+
totalSeconds := microsecondClockValue // 1e6.
11+
^ block
12+
cull: (self fromClockSeconds: totalSeconds - self clockTimezoneOffset)
13+
cull: microsecondClockValue - (totalSeconds * 1e6)

repository/ZTimestamp.package/ZTimestamp.class/instance/^equals.st

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ testing
44
Part of the Magnitude protocol"
55

66
self == aZTimestamp ifTrue: [ ^ true ].
7-
(aZTimestamp isKindOf: self class) ifFalse: [ ^ false ].
8-
^ aZTimestamp julianDayNumber = jdn
9-
and: [ aZTimestamp secondsSinceMidnight = secs ]
7+
self class = aZTimestamp class ifFalse: [ ^ false ].
8+
^ jdn = aZTimestamp julianDayNumber
9+
and: [ secs = aZTimestamp secondsSinceMidnight ]

repository/ZTimestamp.package/ZTimestamp.class/instance/^less.st

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ testing
33
"Answer true when aZTimestamp is strictly later than me, false otherwise.
44
Part of the Magnitude protocol"
55

6-
^ aZTimestamp julianDayNumber = jdn
6+
^ jdn = aZTimestamp julianDayNumber
77
ifTrue: [ secs < aZTimestamp secondsSinceMidnight ]
88
ifFalse: [ jdn < aZTimestamp julianDayNumber ]

0 commit comments

Comments
 (0)