date parse format javascript code example
Example 1: parse date from string in js
Date.parse(dateString)
//dateString is like 2020-10-10 / 2020-10-10T10:20:20
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}`)