Test name | Executions per second |
---|---|
moment | 297757.0 Ops/sec |
date-fns | 274950.3 Ops/sec |
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/date-fns/1.30.1/date_fns.min.js"></script>
window.__date__ = new Date();
window.__expected__ = '2021/09/26';
const actual = moment(__date__).format('DD/MM/YYYY hh:mm A');
const actual2 = moment(__date__).format("hh:mm A");
const actual = dateFns.format(__date__, 'DD/MM/YYYY hh:mm A');
const actual2 = dateFns.format(__date__, 'hh:mm A');