Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
moment.js vs day.js vs date-fns set
(version: 1)
Comparing performance of:
momentjs vs dayjs vs date-fns
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/dayjs/dayjs.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/dayjs/plugin/utc.js"></script> <script src="https://cdn.jsdelivr.net/npm/dayjs/plugin/timezone.js"></script> <script src="https://cdn.jsdelivr.net/npm/moment/moment.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/moment-timezone@0.5.48/builds/moment-timezone-with-data.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/date-fns/cdn.min.js"></script>
Script Preparation code:
var unix = 1724409214;
Tests:
momentjs
return moment(unix).set("hours", 0).set("minutes", 0).set("seconds", 0).set("milliseconds", 0);
dayjs
// dayjs.extend(window.dayjs_plugin_utc) // dayjs.extend(window.dayjs_plugin_timezone) return dayjs(unix).set("hours", 0).set("minutes", 0).set("seconds", 0).set("milliseconds", 0);
date-fns
return dateFns.set(new Date(unix), { hours: 0, minutes: 0, seconds: 0, milliseconds: 0 })
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
momentjs
dayjs
date-fns
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
6 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Safari/605.1.15
Browser/OS:
Safari 26 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
momentjs
1291474.6 Ops/sec
dayjs
1173858.9 Ops/sec
date-fns
4018855.8 Ops/sec
Related benchmarks:
Compare moment vs native date format 2.0
luxon vs datefns vs moment vs dayjs
luxon vs datefns vs moment vs day.js
dayjs vs luxon currentDate
dayjs vs luxon withTimezoneFromString
dayjs vs luxon timeToEnd
Moment Dayjs Date-fns date format benchmark
Moment Dayjs Date-fns date format benchmark with abs comparitor
Moment Dayjs Date-fns end of day comparison
Comments
Confirm delete:
Do you really want to delete benchmark?