I would recomend the dateFormat module (moment.js is deprecated).
Firstly, install the module as follows - always back up your work with Git beforea adding unknown dependencies of course
npm i dateformat
Then call:
//Import Module
let dateFormat = require('dateformat');
//Instantiate New Date & then call func and parse date.
let date = new Date();
var currDate = dateFormat(date, "yyyy, dddd, mmmm dS, h:MM:ss TT");
You could then use currDate to update a field etc.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…