how to change format of date and time in javascript code example Example: js datetime format new Date().toISOString().slice(0, 16).replace("T", " ")