Put number -12661742 into A1, -12661743 into A2, -12662108 into A3. Format all these as date (YYYY-MM-DD) A1 displays reasonable '-32767-01-01'; A2 displays '--32768-12-31' (note two dashes, although the date itself *looks* reasonable); A3 (365 days before A2) displays unexpected '--32767-12-31' - see how the year changes in the wrong direction. Obviously there was a numeric overflow when formatting the year. Bug 129878 had introduced a dedicated "#FMT" indication for numbers not representable in the chosen formatting. This should be used for dates as well, which can't be displayed reasonably - like those outside of '-32767-01-01' (-12661742).
@Eike, I thought you might be interested in this issue
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ebc454ad4eb1f4cd4d84a7db367bb71a457c4e5c Resolves: tdf#144697 Format out-of-bounds date(+time) as #FMT error It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/fd1a63089332153e7180f16961d39c9c12654ff4 tdf#144697: svl_qa_cppunit: Add unittest It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.