date and time formats js code example Example: js datetime format new Date().toISOString().slice(0, 16).replace("T", " ")