Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130
Mac OS X 10.15.7
Desktop
one year ago
JavaScript Date Time format
3.2M/s
JavaScript Date Time format using Template Strings.
3.2M/s
new Date()
1.7M/s
Date().toLocaleString()
31K/s
Intl.DateTimeFormat()
29K/s
View exact numbers
Test name Executions per second
JavaScript Date Time format 3,206,094 Ops/sec
JavaScript Date Time format using Template Strings. 3,200,588 Ops/sec
new Date() 1,661,669 Ops/sec
Date().toLocaleString() 30,844 Ops/sec
Intl.DateTimeFormat() 29,474 Ops/sec
Script Preparation code:
Tests: