Change workbook date system?

Hello,

I have a project that reads data from excel files and puts it in a database. Part of the data that is stored is a date that is retrieved from the worksheets. I am experiencing a problem with some of the worksheets where Aspose.Cells is reading the dates incorrectly. After some research, I discovered that Excel has two different date systems. One of them starts at 1/1/1900 and is the default for Windows machines, and the other starts at 1/2/1904 and is the default for Macintosh machines. In Excel, if I go to Tools -> Options -> Calculations tab, there is a checkbox to enable or disable the 1904 date system.

I would just like to be able to disable the 1904 date system on the fly with Aspose.Cells if possible. My users will have to upload hundreds of spreadsheets, and it would take quite a bit of time to manually configure each workbook to make sure it is using the 1900 date system.

Is there any way to do that using Aspose? If not, is there any way you could add this functionality to Aspose?

I just now realized, if I turn off the 1904 date system manually, it doesn't alter the dates accordingly, so they end up showing an incorrect date. So, maybe I don't need to be able to actually disable the date system.

However, I do need to be able to know what date system is being used. Is there any way you could add functionality to Aspose.Cells that would tell which date format is being used?

If I can tell that the workbook is in 1904 date system, then I can alter the dates appropriately before I save them in the database.

I will add a property to get/set 1904 date system. It will be available in a few days.

Thank you very much.

Are there any updates on this?

Thanks,

Frank M.

Hi Frank,

Please try this attached version. It provides a new property: Workbook.Date1904.

It worked great.

Thanks Laurence!