1904年日付システムを実装する
Contents
[
Hide
]
Microsoft Excelは1900年日付システム(Windows用Excelのデフォルトの日付システム)と1904年日付システムの2つをサポートしています。 1904年日付システムは通常、Macintosh Excelファイルとの互換性を提供するために使用され、Excel for Macintoshを使用している場合はデフォルトのシステムです。 Aspose.Cellsを使用してExcelファイルに1904年日付システムを設定できます。
Microsoft Excel(例えばMicrosoft Excel 2003)で1904年日付システムを実装するには:
-
ツールメニューからオプションを選択し、計算タブを選択します。
-
1904年日付システムオプションを選択します。
-
OK をクリックします。
Microsoft Excelで1904年日付システムを選択する
Aspose.CellsのAPIを使用してこの機能を実現するサンプルコードを以下に示します。
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"); |