Articles in this section
Category / Section

How to use 1904 and 1900 date formats in XlsIO?

1 min read

Generally the date system can be classified into two types.

1)1900 Date System

2)1904 Date System

By default, MS Excel for windows operating system uses 1900 date system and MS Excel for Macintosh Operating system uses the 1904 date system. In XlsIO, we can enable and disable the 1904 date system for the workbook. Here is the sample code for disabling 1904 system using XlsIO.

C#

IWorkbook workbook;
string inputPath = GetFullTemplatePath("Mac.xlsx");
workbook = application.Workbooks.Open(inputPath, ExcelOpenType.Automatic);
 
// To disable the Date1904 system.
workbook.Date1904 = false;

VB

Dim workbook As IWorkbook
Dim inputPath As String = GetFullTemplatePath("Mac.xlsx")
workbook = application.Workbooks.Open(inputPath, ExcelOpenType.Automatic)
 
 ‘To disable the Date1904 system.
workbook.Date1904 = False

 

The sample illustrating this behavior can be downloaded here.

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied