Implementa il sistema della data 1904
Contents
[
Hide
]
Microsoft Excel supporta due sistemi di data: sistema della data 1900 (il sistema di data predefinito implementato in Excel per Windows) e sistema della data 1904. Il sistema della data 1904 è normalmente utilizzato per garantire la compatibilità con i file di Excel per Macintosh ed è il sistema predefinito se si utilizza Excel per Macintosh. È possibile impostare il sistema della data 1904 per i file di Excel utilizzando Aspose.Cells.
Per implementare il sistema della data 1904 in Microsoft Excel (ad esempio Microsoft Excel 2003):
- Dal menu Strumenti, selezionare Opzioni, e selezionare la scheda Calcolo.
- Selezionare l’opzione sistema di data del 1904.
- Fai clic su OK.
Selezione del sistema di data del 1904 in Microsoft Excel |
---|
![]() |
Vedere il seguente codice di esempio su come realizzare questo utilizzando le API di Aspose.Cells. |
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"); |