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