d
Amit DhamuSoftware Engineer
 

YYYY-MM-DD in Javascript

1 minute read 00000 views
const today = new Date()
const date = [
  today.getFullYear(),
  `0${today.getMonth() + 1}`.slice(-2),
  `0${today.getDate()}`.slice(-2),
].join('-')