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:
one year ago
by:
Guest
Go 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:
6 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
Date JS
1.1M/s
Date-Fns
890K/s
MomentJS
473K/s
View exact numbers
Test name
Executions per second
✓
Date JS
1,139,180 Ops/sec
Date-Fns
889,806 Ops/sec
MomentJS
473,313 Ops/sec
Related benchmarks
date-fns vs moment addDays
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?