The only difference is the formatted value/text retrieved. May be it is due to different OS’ (macOS and linux) culture or regional settings. Anyways, could you try using our latest Aspose.Cells for Node.js via Java v19.8 and let us know your feedback:
For locale-depended formatting, we use Java’s builtin number formatter to get the locale specific settings, which may vary according to different platforms, jvms, environment settings, …etc.
Please try below code for your two environments to see whether they give different results or not:
System.out.println(DateFormat.getDateInstance(DateFormat.SHORT, new java.util.Locale(“ja”,“JP”)).format(new java.util.Date()));
@furuta,
As we have said, we use Java’s builtin number formatter to get locale-dependent settings. If you get ‘/’ or ‘-‘ as separator from the default DateFormat, then the formatted result of our component will be ‘/’ or ‘-‘ too. However, It is strange that you get different results for java program and nodejs for the same mac platform. Please check whether you are using the same jdk for both of them? You may check the jdk by code like:
Java:
System.out.println(DateFormat.getDateInstance(DateFormat.SHORT, new Locale("ja", "JP")).format(new Date()));
System.out.println(System.getProperty("java.home"));
NodeJs:
console.log(DateFormat.getDateInstanceSync(DateFormat.SHORT, new Locale("ja", "JP")).formatSync(new Date()))
const System = java.import("java.lang.System")
console.log(System.getPropertySync("java.home"));
Oh, you’re right. Certainly node-java was referred to another JDK. This JDK is a small one generated using jlink. There may have been a problem with this generation method.
This is not an issue with Aspose. Thanks for the advice.