|
From: | Aleksander Morgado |
Subject: | Re: [pdf-devel] Re: Calendar spans |
Date: | Sun, 18 May 2008 19:42:27 +0200 |
User-agent: | Thunderbird 2.0.0.14 (Macintosh/20080421) |
Have you considered doing a survey of other Date/Time/Calendar implementations to find out how they solve this problem? For example, a lot of careful thought and research has gone into the Perl DateTime modules. http://search.cpan.org/dist/DateTime/lib/DateTime.pm#Adding_a_Duration_to_a_Datetime Very interesting. Thanks for the hint! :)
Yes, nice!
It seems that the perl modules uses the same approach I was suggesting: "DateTime.pm always adds (or subtracts) days, then months, minutes, and then seconds and nanoseconds. If there are any boundary overflows, these are normalized at each step. For the days and months (the calendar) the local (not UTC) values are used. For minutes and seconds, the local values are used. This generally just works. This means that adding one month and one day to February 28, 2003 will produce the date April 1, 2003, not March 29, 2003."
Ok, so let's follow this approach. I will explain it in detail in the API reference.
[Prev in Thread] | Current Thread | [Next in Thread] |