Three static methods return timestamps rather than Date objects. Because a timestamp is time-zone neutral, the same value displays as the correct local time for every visitor.
| Method | Returns |
|---|---|
| Date.now() | Current time in ms since the epoch |
| Date.UTC(year, month, day?, h?, m?, s?, ms?) | Timestamp for fields read as UTC |
| Date.parse(string) | Timestamp, or NaN if unrecognized |
const start = Date.now(); // ms since 1970-01-01 UTC
const stamp = Date.UTC(2026, 8, 15, 9, 30); // month 8 = September, in UTC
console.log(stamp, new Date(stamp).toString());
console.log(Date.parse('2026-09-15T09:30:00Z') === stamp, Date.parse('15/09/2026'));
console.log(typeof start, Date.now() - start < 50); // elapsed-time measurement1789464600000 Tue Sep 15 2026 17:30:00 GMT+0800 (Malaysia Time) true NaN number true
Only ISO 8601 and the output of toString() and toUTCString() are guaranteed to parse; other formats vary between engines. For precise timing, use performance.now(), which is monotonic and unaffected by clock changes.