1const event = new Date('05 October 2011 14:48 UTC');
2console.log(event.toString());
3// expected output: Wed Oct 05 2011 16:48:00 GMT+0200 (CEST)
4// (note: your timezone may vary)
5
6console.log(event.toISOString());
7// expected output: 2011-10-05T14:48:00.000Z
8
1date = new Date('2013-03-10T02:00:00Z');
2date.getFullYear()+'-' + (date.getMonth()+1) + '-'+date.getDate();//prints expected format.
1const moment = require("moment");
2const now = moment().utc().toISOString();
3// OR
4const now = moment(new Date()).utc().toISOString();