date format javascript dd-mm-yyyy code example
Example 1: javascript format date yyyy-mm-dd
let today = new Date()
today.toISOString().split('T')[0]
Example 2: javascript format date object to yyyy-mm-dd
const yourDate = new Date()
yourDate.toISOString().split('T')[0]