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
1const myDate = "2012-10-16T11:00:28.556094Z";
2const time = new Date(myDate).toLocaleTimeString('en',
3 { timeStyle: 'short', hour12: false, timeZone: 'UTC' });
4
5// Output: "11:00"
6
1date = new Date(dateISOString);
2 year = date.getFullYear();
3 month = date.getMonth()+1;
4 day = date.getDate();
5 hour = date.getHours();
6 minutes = date.getMinutes();
7
8 if (day < 10) {
9 dt = '0' + dt;
10 }
11 if (month < 10) {
12 month = '0' + month;
13 }
14
15 return finalDate = `${year}/${month}/${day} - ${hour}h:${minutes}mn`;