luofeiyu wrote: ↑Tue Nov 01, 2022 1:35 pm
Why the default day is 1899-12-30 instead of 1899-12-31?Is there some historial story in it?
The purpose is to minimize the error where data transfers between the "industry standard" spreadsheet apps (notably MS Excel) and Calc.
The earliest date Excel handles sensibly is 1900-01-01, which is "day 1" (not zero). This makes "Excel epoch" (day zero) 1899-12-31. However, Excel inherited an error from previous spreadsheet apps which assumed that 1900 was a leap year. The nonexistent 29th of February 1900 is counted in Excel time spans, just like it used to be in Lotus 123 and (IIRC) SuperCalc, and probably in most other relevant spreadsheet apps.
Calc uses a corrected calendar where 1900 is not a leap year. For date values to correspond between Calc and Excel, the "extra day" was catered for by pulling the epoch one day back, to 1899-12-30.
The most prominent consequence of this is that all dates before March 1900 will be one off when you transfer a spreadsheet with date entries between Excel and Calc. The error occurs for 60 dates or so, so a significant impact in some cases, but minimized. It is Excel which is in the wrong (with those other spreadsheet apps), and with negative time values (dates before epoch), Excel is totally lost anyway.