Description: I created a spreadsheet to use as a calendar. On row 67 I changed from typing in every date to using =DAY($A67), where the first day of the week was in column A, the rest of the week was thus done by addition, DAY($A67+1) and so on. That first day is wrong in my file. If I create a new file it works correctly, so there must be a file error that is not detected. This is an issue because it works in excel yet gives the wrong information in Calc. Steps to Reproduce: 1. Load file 2. Go cell where error day is wrong 3. clear cell. Type in =day(<cell>) and see error reproduced. 4. If you go to a new cell then day appears to work, but copying a nonworking cell and pasting somehow corrupts that newly pasted cell so that Day() subtracts 1. Actual Results: reported Day is off by 1. This happens on different computers running Libreoffice. Expected Results: reported day should match the date. Reproducible: Always User Profile Reset: No Additional Info: User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36
Created attachment 129305 [details] File showing a Day function issue starting on cell C5. This file is required to reproduce the issue.
No bug here. Format cell as standard and you will get expexted result. A6 contains date July 31th of 2016, C6 contains =DAY(A6), result of C6 formula is 31. Format of C6 cell is "DD", so it returns the day of the 31 days after date origin which is set to 1899-12-30 in Calc. "1899-12-30"+31 → 1900-01-30 DAY("1900-01-30") = 30 You get 31 in Excel because Excel start one days later due that they incorrectly considers 1900 as a leap year.