Implementierung des 1904 Datumsystems mit C++

Contents
[ ]

Um das 1904-Datensystem in Microsoft Excel zu implementieren (zum Beispiel Microsoft Excel 2003):

  1. Wählen Sie im Extras-Menü die Option Optionen und wählen Sie den Tab Berechnung.
  2. Wählen Sie die Option 1904-Datensystem aus.
  3. Klicken Sie auf OK.
Auswählen des 1904-Datensystems in Microsoft Excel
todo:image_alt_text
Sehen Sie sich den folgenden Beispielcode an, wie Sie dies mit Aspose.Cells-APIs erreichen können.
#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();
}