Is there any simple way to get a number of milliseconds elapsed since 1 January 1970 00:00:00 UTC
simular the Date.now()
javaScript function?
Use the valueOf
method on a moment object:
For local time:
moment().valueOf();
For UTC:
moment().utc().valueOf();
To get current date you may use the following line in your js file:
var currentDate = moment().format("DD-MM-YYYY");
It will show the date of the given format 19-Mar-2015
Click here to visit moment.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With