Date string to date object, then .toLocaleDateString

by greatCar

JavaScript

let d = new Date("2019")
alert (d.toLocaleDateString());