[LEAPSECS] Localization tables

Rob Seaman seaman at noao.edu
Tue Feb 22 17:22:34 EST 2011


On Feb 22, 2011, at 3:04 PM, Warner Losh wrote:


> while the leap-year code is:

>

> return (year % 400) == 0 || (year % 4 == 0 && year %100 != 0)

>

> which will last us about a thousand years.


Define "last us". Historical date comparisons require knowledge of how the calendar has evolved in different locales. Such cannot be encapsulated in a deterministic formula but rather requires some sort of tabular lookup.

The corresponding formula for the Chinese lunisolar calendar is left as an exercise for the eager student.

Clock and calendar use cases are diverse. The resulting requirements many. For example, consider them from the view point of localization. Languages vary, numerical formats vary, date and time representations vary - and so do the underlying calendars and clocks.

As with other software localization issues, this is complexity to manage not to sweep under the rug.

Rob



More information about the LEAPSECS mailing list