See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat

Xiao-Hu Tai
2018-11-27T08:46:52Z

dateformatter.js

| const dateFormatOptions = {
| year: 'numeric',
| month: 'numeric',
| day: 'numeric',
| hour: 'numeric',
| minute: 'numeric',
| second: 'numeric',
| };
| const dateFormatter = new Intl.DateTimeFormat(document.documentElement.lang, dateFormatOptions);
|
| console.log(dateFormatter.format(new Date()))