Convert Dates to Japanese Dates
Contents
[
Hide
]
In the Japanese** **Calendar, a new era begins with the reign of a new emperor. On 1st May 2019, a new emperor came into power with which the Heisei era ended and the Reiwa era began.
Aspose.Cells provides a way to convert Gregorian dates to Japanese dates. During this conversion, the changes in the era are also considered. The following code snippet converts the source Excel file containing Gregorian dates to the output PDF with Japanese dates as shown in the image below.
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); |