Getting the Current Date and Time

new Date();

To get the current date and time, create a new Date() object without passing parameters. This creates an object with the current date and time.

Get jQuery and JavaScript Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.