how to convert date to dateTime string js code example Example: convert date to string javascript var d = new Date(); var n = d.toDateString();