Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
test moment object in local and utc format
var moment = require("moment")
// format the current date
var now = moment();
console.log(now.format("YYYY-MM-DDTHH:mm:ss.SSS[Z]"))
console.log(moment(now.format("YYYY-MM-DDTHH:mm:ss.SSS[Z]")).diff("2020-06-27T07:24:41.690Z"))
console.log(now.diff("2020-06-27T07:24:41.690Z"))
// moment API
moment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment