日本の日付への変換
Contents
[
Hide
]
日本のカレンダーでは、新しい天皇の即位とともに新しい元号が始まります。2019年5月1日に新しい天皇が即位し、平成時代が終了し令和時代が始まりました。
Aspose.CellsはGregorian暦の日付を日本の日付に変換する方法を提供します。この変換では元号の変更も考慮されます。以下のコードスニペットは、ソースエクセルファイルを読み込んで、日本の日付を含む出力PDFに変換するものを示しています。
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 | |
//Source directory | |
string sourceDir = RunExamples.Get_SourceDirectory(); | |
//Output directory | |
string outputDir = RunExamples.Get_OutputDirectory(); | |
LoadOptions options = new LoadOptions(LoadFormat.Xlsx); | |
options.CultureInfo = new CultureInfo("ja-JP"); | |
Workbook workbook = new Workbook(sourceDir + "JapaneseDates.xlsx", options); | |
workbook.Save(outputDir + "JapaneseDates.pdf", SaveFormat.Pdf); |