Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Timezone format: Intl.DateTimeFormat vs. Moment.js vs. Luxon
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Browser:
Chrome 127
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Native
26612.3 Ops/sec
Luxon
160677.2 Ops/sec
HTML Preparation code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/luxon/3.3.0/luxon.min.js" integrity="sha512-KKbQg5o92MwtJKR9sfm/HkREzfyzNMiKPIQ7i7SZOxwEdiNCm4Svayn2DBq7MKEdrqPJUOSIpy1v6PpFlCQ0YA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
Script Preparation code:
window._date = new Date(); window._now = _date.getTime(); window._iso = _date.toISOString();
Tests:
Native
const dateTimeFormat = new Intl.DateTimeFormat("en-GB", { timeZone: "Europe/Prague", timeZoneName: "longOffset", year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", }).formatToParts(_now); var dt = {}; dateTimeFormat.forEach((arrayPart) => { if (arrayPart.type !== "literal") { dt[arrayPart.type] = arrayPart.value; } }); var date = `${dt.year}-${dt.month}-${dt.day}T${dt.hour}:${dt.minute}:${dt.second}${dt.timeZoneName.slice(3)}`; console.assert(date === _iso);
Luxon
var date = luxon.DateTime.now().setZone('Europe/Prague').toISO(); console.assert(date === _iso);