将日期转换为日本日期
Contents
[
Hide
]
在日本** **历法中,新的一个时代开始于新天皇的即位。2019年5月1日,新天皇即位,平成时代结束,令和时代开始。
Aspose.Cells提供一种将公历日期转换为日本日期的方式。在此转换过程中,还会考虑时代变化。以下代码片段将包含公历日期的源Excel文件(90112015.xlsx)转换为包含日本日期的output 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); |