Implementieren Sie das 1904 Datensystem
Contents
[
Hide
]
Microsoft Excel unterstützt zwei Datensysteme: das 1900-Datensystem (das Standarddatensystem in Excel für Windows) und das 1904-Datensystem. Das 1904-Datensystem wird normalerweise verwendet, um die Kompatibilität mit Macintosh Excel-Dateien zu gewährleisten und ist das Standard-System, wenn Sie Excel für Macintosh verwenden. Sie können das 1904-Datensystem für Excel-Dateien mit Aspose.Cells einstellen.
Um das 1904-Datensystem in Microsoft Excel zu implementieren (zum Beispiel Microsoft Excel 2003):
- Wählen Sie im Extras-Menü die Option Optionen und wählen Sie den Tab Berechnung.
- Wählen Sie die Option 1904-Datensystem aus.
- Klicken Sie auf OK.
Auswählen des 1904-Datensystems in Microsoft Excel |
---|
![]() |
Sehen Sie sich den folgenden Beispielcode an, wie Sie dies mit Aspose.Cells-APIs erreichen können. |
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-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Initialize a new Workbook | |
// Open an excel file | |
Workbook workbook = new Workbook(dataDir+ "book1.xlsx"); | |
// Implement 1904 date system | |
workbook.Settings.Date1904 = true; | |
// Save the excel file | |
workbook.Save(dataDir+ "Mybook.out.xlsx"); |