Moment JS

Example of parsing and formatting a Date with Moment JS.

by Aswin Devarajan

HTML

<script src="http://momentjs.com/downloads/moment.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lodash.min.js"></script>

JavaScript

//let test = parseInt(moment().unix()/900)

//console.log(moment.unix((test)*900).format())

//console.log(moment.unix((test-1)*900).format())

console.log(moment.unix(1548855900.828).format())

console.log(moment.unix(1548855000.828).format())