The Timing of Time

Alan Lovejoy squeak-dev.sourcery at forum-mail.net
Wed Apr 19 02:38:14 UTC 2006


Francisco: "Could you summarize Chronos by saying: `Historic dates on a
global timeline`?"

That would be a partial summary. Chronos is intended to provide both a
scientifically-correct, a legally-correct and a culturally-correct model of
time, to provide the ability to represent values in the date/time domain
(dates, times-of-day, timestamps, durations, temporal intervals, etc,) to
provide useful operations and functions on values in the date/time domain,
to conform to relevant standards and conventions (e.g., ANSI Smalltalk, ISO
8601, etc.,) and to satisfy the requirements of all relevant Use Cases.

Most date/time implementations don't properly distinguish between "civil
time" and "scientific time."  Most don't provide duration objects, let alone
properly distinguish between civil and scientific durations (and provide for
both.) Most don't properly distinguish between nominal-time invariance and
Universal-Time invariance.  Most don't properly distinguish between a time
zone and a time scale (and the majority don't even have any time zone
support at all, let alone provide any support for multiple time scales.)
Most don't support leap seconds. Most support only one calendrical system.

Francisco: "I don't understand why you need so many different calendars. For
the example that I first posted (adjust a schedule to the japanese
calendar), you suggested that the Japanese imperial calendar would need to
be implemented. I would like to know what kind of applications are you
dealing with, in which expressing the dates in the original calendar is
important. For a financial application, the japanese calendar is just
another gregorian calendar with certain dates defined as bank holidays."

In many coutries, the laws of the land at least occasionally are expressed
in terms of some non-Gregorian calendar.  In some cases, all the laws, and
the courts, only use some non-Gregorian calendar.  Some countries specify
time zone offset transition  dates using some non-Gregorian calendar.  Some
countries have legal holidays whose annual occurrence rules are specified in
some non-Gregorian calendar.  The whole population of some countries prefers
to use some non-Gregorian calendar in their daily lives.

Of course, you are correct that it is quite possible to convert dates from
one calendar to another, and to simply use a list of such converted dates
instead of an annual recurrence rule.  However, using that approach changes
a simple annual-date recurrence rule as expressed in one calendar (e.g., 15
Nisan) to either a very complex formula (try open coding the algorithm that
converts 15 Nisan to a Gregorian date--just for a single year,) or to a list
of dates that must a) be computed somehow, and then b) managed and accessed
as reference data by applications that can't natively handle Hebrew dates.

So, if you're quite happy to just use a list of Japanese holiday dates
expressed as Gregorian dates that someone has computed for you, then there's
no reason you couldn't just use a Chronos SemanticDatePolicy without having
to implement a Chronos Calendar class for the Japanese Imperial Calendar. Of
course, adding the British holiday recurrence rules, and adding(and managing
updates to) the list of Japanese holidays as list of absolute (Gregorian)
dates, would be the responsibility of your application, since Chronos only
predefines the US rules for you.

--Alan






More information about the Squeak-dev mailing list