Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
luxon3-vs-date-format-fromJSDate
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15
Browser:
Safari 17
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
js date
7799875.5 Ops/sec
luxon date
516333.3 Ops/sec
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/luxon@3.4.4/build/global/luxon.min.js"></script>
Script Preparation code:
window.ds = "2020-02-19T00:51:53.623839+00:00"; window.formatDate = function (date, includeTime, dateDelimiter = '/') { let hours = date.getHours(); const minutes = date.getMinutes(); const seconds = date.getSeconds(); const fullSeconds = seconds < 10 ? `0${seconds}` : seconds; const fullMinutes = minutes < 10 ? `0${minutes}` : minutes; const ampm = hours >= 12 ? 'PM' : 'AM'; hours = hours % 12; hours = hours ? hours : 12; if (!includeTime) { return `${date.getMonth() + 1}${dateDelimiter}${date.getDate()}${dateDelimiter}${date.getFullYear()}`; } return `${date.getMonth() + 1}${dateDelimiter}${date.getDate()}${dateDelimiter}${date.getFullYear()} - ${hours}:${fullMinutes}:${fullSeconds} ${ampm}`; };
Tests:
js date
window.formatDate(new Date(window.ds), true);
luxon date
luxon.DateTime.fromJSDate(new Date(window.ds)).toFormat("mm/dd/yyyy - h:mm:ss a");