
Andrew Pimlott
The best time library I've used is Perl's DateTime. (Anyone who thinks that everything in Perl is a bad hack, please suspend judgement for a minute!) It has DateTime, DateTime::Duration, and DateTime::TimeZone classes (along with a host of supporting players, such as the handy DateTime::Span), and addresses the various ambiguities. (Another example not yet discussed here: The difference between two times can be expressed in years, days, hours, or seconds, so the library lets you choose.) I believe it gets all the date math right, including leap seconds. It is the result of considerable development, use, and experience with other time libraries.
The project is at
and if you click the modules link, you can read the documentation.
There certainly seem to be a lot of good ideas here. In addition to DateTime and DateTime::Span there are sets DateTime::Set and DateTime::SpanSet for representing various kinds of sets of time. Various events and calendars make use of these. -- Ashley Yakeley, Seattle WA