Created
June 12, 2020 08:32
-
-
Save Devendra0110/e75454d08fe36610e2d97b1861f06b5d to your computer and use it in GitHub Desktop.
test moment object in local and utc format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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