Answers for "how to make a single digit date start with zero"

0

how to make a single digit date start with zero

const today = new Date()

const year = today.getFullYear()

const month = `${today.getMonth() + 1}`.padStart(2, "0")

const day = `${today.getDate()}`.padStart(2, "0")

const stringDate = [day, month, year].join("/") // 13/12/2017
Posted by: Guest on October-08-2021

Code answers related to "how to make a single digit date start with zero"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language