I am seeing some strange behavior with dates in Base when transferring the database from Linux to Windows and then back again. I created the database on a Linux box (Zorin OS 15) several years ago and have added to it on a succession of Linux machines over the years, with no issues. Recently, I had to make some additions to the database from a Windows machine. However, in opening the database on the Windows machine, many (but not all) of the dates were off by one day. After a lot of troubleshooting, I finally decided to empty my database of data and then add some dummy date, first on the Linux machine and then on the Windows machine. Here is what I found.
I started with the Linux machine, adding records with various dates. Here is what my table looked like:
- I then moved the database to the Windows machine. I noticed that all dates in the months of January, February, November, and December were fine. BUT dates from April 1 to October were off by one day; the Windows machine displayed them as one day earlier (e.g., 4/1/20 became 3/31/20).
Here is a screenshot of how the table looked on Windows:
I then added new records to the database from the Windows machine, using the same dates that I had originally entered on the Linux machine. (So now I had two identical entries in the database - one made on the Windows machine and one made on the Linux machine.) So now my table looked like this:
I then moved the database back to my Linux machine, and it looked the same as it did on the Windows machine. In other words, by opening the database on Windows, the database was permanently damaged in that the dates I had entered in Linux from April 1 through October were now off by one day.
My troubleshooting with dummy data does not explain all of the anomalies I was seeing with my real database. For example, when another user with a different Windows machine entered data into the database, all of the dates she entered were off by one day when I viewed the database on my Linux machine. (By contrast, in my test case, the dates I entered on the Windows machine displayed correctly on my Linux machine.) Also, when I viewed my real database on my Windows machine, the dates that were off did not always fit into the April 1 through October paradigm (e.g., one record with a date of April 1 displayed correctly on both the Windows and Linux machines). But at least my troubleshooting demonstrated some repeatable anomalous behavior.
I have reviewed the following: https://ask.libreoffice.org/t/base-connect-mysql-jdbc-timezone-error/33024/1
https://ask.libreoffice.org/t/dates-in-database-column-have-shifted-by-one-day/41801
My Linux box is running Zorin OS 16.3 and LibreOffice 7.5.5.2 (x86_64), although I have used various iterations of Linux and LibreOffice with this database over the years and on several different machines, and I never had any date issues before I edited the data on a Windows machine.
My Windows machine is running Windows 11 Enterprise, version 22H2 and LibreOffice 7.5.2.2 (x86_64).
I have tried turning off “Use ODBC conformant date/time literals,” but that had no impact on the issue.
Here is my database file:
10111 (dummy data only - from Linux and Windows).odb (194.1 KB)
Any ideas on what might be causing this and how to fix it? Thanks!!