Implementieren Sie das 1904-Datumssystem
Contents
[
Hide
]
Microsoft Excel unterstützt zwei Datumssysteme: 1900-Datumssystem (das Standarddatumssystem, das in Excel für Windows implementiert ist) und 1904-Datumssystem. Das 1904-Datumssystem wird normalerweise verwendet, um Kompatibilität mit Macintosh-Excel-Dateien bereitzustellen, und ist das Standardsystem, wenn Sie Excel für Macintosh verwenden. Sie können das 1904-Datumssystem für Excel-Dateien mit Aspose.Cells einstellen.
So implementieren Sie das 1904-Datumssystem in Microsoft Excel (z. B. Microsoft Excel 2003):
- Von demWerkzeug Menü, auswählenOptionen , und wählen Sie die ausBerechnung Tab.
- Wähle aus1904 Datumssystem Möglichkeit.
- KlickenOK.
Auswahl des Datumssystems 1904 in Microsoft Excel
Im folgenden Beispielcode erfahren Sie, wie Sie dies mit Aspose.Cells-APIs erreichen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(Implement1904DateSystem.class); | |
// Initialize a new Workbook | |
Workbook workbook = new Workbook(dataDir + "Mybook.xlsx"); | |
// Implement 1904 date system | |
workbook.getSettings().setDate1904(true); | |
// Save the excel file | |
workbook.save(dataDir + "OutPut.xls"); |