Implement 1904 Date System with C++

Contents
[ ]

To implement 1904 date system in Microsoft Excel (for example Microsoft Excel 2003):

  1. From the Tools menu, select Options, and select the Calculation tab.
  2. Select the 1904 date system option.
  3. Click OK.
Selecting 1904 date system in Microsoft Excel
todo:image_alt_text
See the following sample code on how to achieve this using Aspose.Cells APIs.
#include <iostream>
#include "Aspose.Cells.h"

using namespace Aspose::Cells;

int main()
{
    Aspose::Cells::Startup();

    // Source directory path
    U16String srcDir(u"..\\Data\\01_SourceDirectory\\");

    // Output directory path
    U16String outDir(u"..\\Data\\02_OutputDirectory\\");

    // Path of input excel file
    U16String inputFilePath = srcDir + u"book1.xlsx";

    // Path of output excel file
    U16String outputFilePath = outDir + u"Mybook.out.xlsx";

    // Create workbook
    Workbook workbook(inputFilePath);

    // Implement 1904 date system
    WorkbookSettings settings = workbook.GetSettings();
    settings.SetDate1904(true);

    // Save the excel file
    workbook.Save(outputFilePath);

    std::cout << "Excel file saved successfully with 1904 date system!" << std::endl;

    Aspose::Cells::Cleanup();
}