Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36
Chrome 80
Windows
Desktop
4 years ago
Test name Executions per second
Moment 24148.5 Ops/sec
Offset 44036.1 Ops/sec
HTML Preparation code:
AخA
 
1
<script src="https://cdn.rawgit.com/moment/moment/2.7.0/moment.js"></script>
2
<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

    x
     
    var dateString = moment().format();
  • Offset

     
    var newDateObject = new Date().toLocaleDateString();