Javascript Date toDateString()
displays the date's day of the week, month, day of the month, and year in an implementation-specific format.
The output of this method varies from browser to browser.
dateObj.toDateString()
let d = new Date(2020, 6, 28, 14, 39, 7); console.log(d.toString()); /*from w w w .j av a 2 s . c o m*/ console.log(d.toDateString());
Month are 0-indexed when used as an argument of Date.
0 corresponds to January and 11 to December.