I need a specific format, from JavaScript Date object [closed]

Try this

let d = new Date();
const monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "June",
" July", "Aug", "Sep", "Oct", "Nov", "Dec"

const d = new Date();
console.log(d.getHours() + ", " + monthNames[d.getMonth()] + " " + d.getDate());

You can change monthNames to suit your needs.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top