Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
new Date() // Current time new Date(1718000000000) // From timestamp (ms) new Date("2024-06-15") // ISO date string (UTC midnight) new Date("2024-06-15T10:30:00") // ISO with time (local time) // Note: months are 0-indexed! new Date(2024, 5, 15) // June 15, 2024 (month 5 = June) // Get timestamp Date.now() // Current time as ms new Date("2024-01-01").getTime()
Result
Open