function join(t, a, s) { function format(m) { let f = new Intl.DateTimeFormat('en', m); return f.format(t); } return a.map(format).join(s); } let a = [{day: 'numeric'}, {month: 'short'}, {year: 'numeric'}]; let s = join(new Date, a, '-'); console.log(s);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter