Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Date JS VS Date-Fns VS MomentJS - startOfDay
(version: 1)
Comparing performance of:
Date JS vs Date-Fns vs MomentJS
Created:
9 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/moment@2.29.4/moment.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/date-fns/cdn.min.js"></script>
Script Preparation code:
var unix = 1724409214;
Tests:
Date JS
const now = new Date(); const startOfDayUTC = new Date(now); startOfDayUTC.setUTCHours(0, 0, 0, 0); const isoString = startOfDayUTC.toISOString();
Date-Fns
const now = new Date(); const startOfDayUTC = dateFns.startOfDay(now); const isoString = startOfDayUTC.toISOString();
MomentJS
const isoString = moment().utc().startOf('day').toISOString();
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Date JS
Date-Fns
MomentJS
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
3 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Browser/OS:
Chrome 142 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Date JS
1139180.5 Ops/sec
Date-Fns
889806.5 Ops/sec
MomentJS
473312.8 Ops/sec
Related benchmarks:
date-fns vs moment addDays
date-fns vs moment addDays2
MomentJS VS Date
MomentJS VS Date - ttlSec
MomentJS VS Date VS Date-Fns - getRoundedDate
MomentJS VS Date VS Date-Fns - ttlSec
MomentJS VS Date VS Date-Fns - getRoundedDate #2
Date JS VS Date-Fns - startOfDay
Date JS VS MomentJS VS Date-Fns - isValid
Comments
Confirm delete:
Do you really want to delete benchmark?