The date format you see depends on the localization setting you have in place. If you're working with electron, a useful method to get the locale string is through app.getLocale().
When it comes to obtaining a well-defined date format string for different locales, you can either create your own mapping or utilize external libraries like Moment.js. Moment.js provides dateFormat information that can also help you format dates according to your requirements.
For a demonstration on how to obtain a longDateFormat using a locale string, check out this fiddle.
let l = moment().locale('en');
console.log(l.localeData().longDateFormat('L'));
l = moment().locale('es');
console.log(l.localeData().longDateFormat('L'));