momentjs vs xaprb (v5)

Revision 5 of this benchmark created by Dony Antony on


Preparation HTML

<script src="http://flexible-js-formatting.googlecode.com/svn/trunk/dates/date-functions.js"></script>
<script src="https://raw.github.com/timrwood/moment/master/moment.js"></script>
<script src="https://raw.github.com/datetimejs/DateTimeJS/master/src/datetime.min.js"></script>
<script src="http://tempus-js.com/tempus/tempus.js"></script>

<script>
var m = moment();
var d = new Date();
var y = new DateTime(); // Added DateTimeJS in Test 3
var dt = new Tempus();

if (console && console.log) {
  console.log(m.format('MM-DD-YYYY h:mm:ss a'), 'MomentJS format');
  console.log(d.dateFormat('m-d-Y h:i:s a'), 'xaprb format');
  console.log(y.format('MM-dd-yyyy h:mm:ss tt'), 'DateTimeJS format');
  console.log(dt.toString('%m-%d-%G %l:%M:%S %P'));
}
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
MomentJS
m.format('MM-DD-YYYY h:mm:ss a');
ready
xaprb
d.dateFormat('m-d-Y h:i:s a');
ready
DateTimeJS
y.format("MM-dd-yyyy h:mm:ss tt");
ready
Tempus
dt.toString('%m-%d-%G %l:%M:%S %P')
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by Tim on
  • Revision 5: published by Dony Antony on