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

_______________________________________________
LEAPSECS mailing list
[email protected]
http://six.pairlist.net/mailman/listinfo/leapsecs

Reply via email to