how to present date in some format Aug. 1, 2020, 3:17 p.m. using javascript code example
Example 1: how to print date like 10-may-2018 in javascript
date.toString('YYYY-MM-dd'); 'Tue Feb 10 2015 15:42:50'
var date = new Date('4-1-2015');
date.getDay();
date.getYear();
date.getFullYear();
date.getMonth();
date.getUTCDate();
Example 2: javascript date format
const d = new Date('2010-08-05')
const ye = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(d)
const mo = new Intl.DateTimeFormat('en', { month: 'short' }).format(d)
const da = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(d)
console.log(`${da}-${mo}-${ye}`)