GNOME Bugzilla – Bug 599461
DATEDIF issue
Last modified: 2009-12-08 19:38:30 UTC
=datedif(date(1901,2,28),date(1901,3,1),"d") evaluates (correctly) to 1. =datedif(date(1900,2,28),date(1900,3,1),"d") on the other hand evaluates incorrectly to 2. For compatibility with XL we might need to have a "skip" in the serial numbers as if there were a February 29, 1900, but functions such as datedif should account for that!
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Note, that the calculation now goes xl_serial -> dmy -> glib_julian for both dates followed by a subtraction. That's somewhat expensive for something that is basically always a subtraction! It does have the benefit of making the semantics saner: we used to assume there was no time-of-day part of the date and get strange results if not.