I want to get the Unix TimeStamp using Moment.js. I can find many functions which convert timestamp to date in moment.js. I know that I can easily get the unix timestamp by usin
For anyone who finds this page looking for unix timestamp w/ milliseconds, the documentation says
moment().valueOf()
or
+moment();
you can also get it through moment().format('x')
(or .format('X')
[capital X] for unix seconds with decimal milliseconds), but that will give you a string. Which moment.js won't actually parse back afterwards, unless you convert/cast it back to a number first.