[vox-tech] Easiest way to calculate date in 100 ns increments?
Rick Moen
rick at linuxmafia.com
Wed Jun 23 15:33:51 PDT 2004
Quoting Mark K. Kim (lugod at cbreak.org):
> BTW, `cal 9 1752` may amuse some people:
>
> $ cal 9 1752
> September 1752
> Su Mo Tu We Th Fr Sa
> 1 2 14 15 16
> 17 18 19 20 21 22 23
> 24 25 26 27 28 29 30
>
>
>
> $ _
>
> Somehow changing the locale doesn't change `cal`'s behavior. It should,
> though. A bug, perhaps?
Country code rather than locale, I think, and it might depend on the
_implementation_ of cal.
BSD cal's manpage includes:
-s country_code
Assume the switch from Julian to Gregorian Calendar at the date
associated with the country_code. If not specified, ncal tries
to guess the switch date from the local environment or falls back
to September 2, 1752. This was when Great Britain and her
colonies switched to the Gregorian Calendar.
Whereas gcal includes:
`--gregorian-reform=1582|1700|1752|1753|ARGUMENT'
Set the period which was skipped during the Gregorian Reformation.
By default, Gcal runs in the "hybrid" calendar mode, i.e. Gcal
automatically changes from the Julian calendar system to the
Gregorian calendar system if output is related to dates after the
Gregorian Reformation has happened. *Note Aspects in
Internationalization: Internationalization, for more details.
Actually, four fixed default periods are supported, and that of
the year 1582, of the year 1700, of the year 1752 and of the year
1753.
If Gcal is called with the `--gregorian-reform=1582' option, it
assumes the Gregorian Reformation has occurred from 5th till 14th
October 1582.
If Gcal is called with the `--gregorian-reform=1700' option, it
assumes the Gregorian Reformation has occurred from 19th till 28th
February 1700.
If Gcal is called with the `--gregorian-reform=1752' option, it
assumes the Gregorian Reformation has occurred from 3rd till 13th
September 1752.
If Gcal is called with the `--gregorian-reform=1753' option, it
assumes the Gregorian Reformation has occurred from 18th till 28th
February 1753.
In case another period shall be respected, it can be arranged by
the option ARGUMENT like `YYYYY,MM,FIRST-DAY,LAST-DAY'. If the
Gregorian Reformation has occurred for example on the 7th till the
17th April 1802, this can be arranged as follows:
--gregorian-reform=1802,4,7,17
Gcal is able to represent so-called "proleptic" calendars of a
definite calendar system. This means, Gcal only uses a definite
calendar system during a definite period, although there was a
change to another calendar system in the historic reality during
this definite period. The following proleptic calendar systems
are actually supported by Gcal:
* Proleptic Gregorian calendars can be created from AD 302 until
AD 9999 if `--gregorian-reform=301,12,31,31' is used.
Unfortunately, Gcal actually cannot represent years before AD
302 in a proleptic-Gregorian manner.
* Proleptic Julian calendars can be created from AD 1 until AD
9999 if `--gregorian-reform=10002,12,31,31' is used. In this
case, the actual system date that is normally based on the
Gregorian calendar and that is used by Gcal, is internally
and automatically converted into the according Julian date(4)
(*note Calendar options-Footnote-4::). The same happens if
the actual system date is modified by using the actual date
modifier `%DATE'. In such a case, Gcal also assumes that the
given date is a Gregorian date, and converts it automatically
into the according Julian date internally. *Note Actual date
modifier::, for further details.
Please note that it is possible to corrupt the calendars likewise
the fixed date feature logically (which works correctly now for
the year in which the Gregorian Reformation has occurred) if the
argument of the `--gregorian-reform' option is not used with care.
More information about the vox-tech
mailing list