Design & Download
Your JS Library
in Seconds!!!

Snippet: now() - Current Date/Time

Written by Christopher West (cwest) on December 06, 2015.
Creates a date object for the current date/time.
function now() {
  return new Date;
}
now.valueOf = function() {
  return +now();
};

now() API Documentation

Description

Creates a date object for the current date/time.

Returns

Returns a Date object representing the current date/time.

Extras

In addition, if you want to get the current timestamp, you can evaluate something like this:
console.log(+YourJS.now);
The above code will show the current timestamp in the console log.