使用 Node.js 通过 C++ 将日期转换为日本日期

Contents
[ ]

Aspose.Cells 提供一种将公历日期转换为日本日期的方法。在此转换过程中,也考虑了时代的变化。下面的代码片段将包含公历日期的源Excel文件转换为带有日本日期的输出PDF,如下图所示。

todo:image_alt_text

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// Source directory
const sourceDir = path.join(__dirname, "data");

// Output directory
const outputDir = path.join(__dirname, "output");

const options = new AsposeCells.LoadOptions(AsposeCells.LoadFormat.Xlsx);
options.setLanguageCode(AsposeCells.CountryCode.Japan);
options.setRegion(AsposeCells.CountryCode.Japan);

const workbook = new AsposeCells.Workbook(path.join(sourceDir, "JapaneseDates.xlsx"), options);
workbook.save(outputDir + "JapaneseDates.pdf", AsposeCells.SaveFormat.Pdf);