[tz] Direct implementation of mktime_z

Howard Hinnant howard.hinnant at gmail.com
Wed Sep 28 13:24:01 UTC 2022


On Sep 28, 2022, at 7:36 AM, Ted Phelps via tz <tz at iana.org> wrote:
> 
> On 28/9/22 00:45, Howard Hinnant wrote:
>> On Sep 27, 2022, at 5:54 AM, Ted Phelps via tz <tz at iana.org> wrote:
>> 
>> On 27/9/22 14:17, Bradley White wrote:
>>>> Assuming we want to model the proleptic Gregorian calendar, it would be nice if the output was linear over all inputs.  At the moment, for example, daynum(0, 2, 29) and daynum(0, 3, 1) both return -305.
>>> Ah, nice find!  I forgot to compensate for division by negative numbers, and my test suite doesn't cover times before about 1800. I'll fix both shortcomings shortly.
>>> 
>>> -Ted
>> If it helps, public domain calendrical algorithms for the proleptic Gregorian calendar that have a domain of validity of +/- millions of years, centered on the Unix epoch:
>> 
>> http://howardhinnant.github.io/date_algorithms.html
> 
> Thanks, that's an excellent resource.  I like the use of 'era' to refer to a block of 400 years.  Is that a standard term?

I haven't seen the use of eras before, nor the use of the equation that transforms a day-of-era into a year-of-era before. However I would be surprised if this was the first use of these formulations.

Howard

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <https://mm.icann.org/pipermail/tz/attachments/20220928/89dba316/signature.asc>


More information about the tz mailing list