Folks,
I am trying to understand the MomentJS API. What is the appropriate way to get the current time on the machine?
var CurrentDate = moment();
vs
var CurrentDate = moment().format();
Trying to parse their docs, and its not apparent what to use.
Here you are assigning an instance of momentjs to CurrentDate:
Here just a string, the result from default formatting of a momentjs instance:
And here the number of seconds since january of... well, unix timestamp:
And here another string as ISO 8601 (What's the difference between ISO 8601 and RFC 3339 Date Formats?):
And this can be done too:
Try this
Still, no answer. Moment.js - Can do anything but such a simple task.
I'm using this:
Get by Location:
Try this way:
Format Dates:
Visit: https://momentjs.com/ for more info.
moment().unix()
you will get a unix timestampmoment().valueOf()
you will get a full timestamp