[tz] Direct implementation of mktime_z

Ted Phelps phelps at pobox.com
Wed Sep 28 11:36:24 UTC 2022

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?


More information about the tz mailing list