new date value code example Example: new Date var mydate = new Date('23/4/2021 6:15 pm'); console.log(mydate.toDateString());