Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Moment Tests timestamp 2
(version: 0)
Comparing performance of:
Moment vs Offset
Created:
3 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.rawgit.com/moment/moment/2.7.0/moment.js"></script> <script src="https://cdn.rawgit.com/moment/moment-timezone/0.2.2/builds/moment-timezone-with-data.js"></script></script>
Script Preparation code:
var dateObject = new Date('2016-11-03T12:00:00Z'); var timezone = 'Australia/Perth'; var format = 'YYYY-MM-DDTHH:mm:ss';
Tests:
Moment
function dateFormatTimestamp() { const nb = moment.utc().format('X'); const timestamp = Math.floor(Number(nb)); return timestamp; } var ts = dateFormatTimestamp()
Offset
function dateFormatTimestamp() { return Math.floor(Date.now() / 1000); } var ts = dateFormatTimestamp()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Moment
Offset
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Moment Tests
Moment format vs new Date().toLocaleDateString()
Moment format vs new Date().toISOString, no ms
Moment Tests timestamp 2 millis
Moment UTC Tests
Comments
Confirm delete:
Do you really want to delete benchmark?