How to get current Date and Time using JavaScript

| Last Updated: | In: Javascript & Ajax

In this tutorial i will let you know the very esay and simple way to get current Date and Time using JavaScript code. I will explain with demo examples because i know examples are 1000 time better than text explanations. It is often easier to understand the code.

You can get the current date and time using var today = new Date(); function, It will return the standard date time format like below if you are from india:


JavaScript get current date


Use below code to get current date from JavaScript Date() object in Y-m-d format.

Another date and time from Date() object in Y-m-d H:i:s format.

JavaScript ISO (Date-Time) format


Tags: , , , , , ,

About: Prem Tiwari

Prem Tiwari is the founder of and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.

You may also like:

Get Free Access of 450+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Free Guide: Learn how to implement security guideline in your WordPress site...


Free WordPress Setup Service

Free WordPress Setup

Want to Setup WordPress Blog Setup? I will help you in the setup of your WordPress blog.

Click Here

Pincode Finder

pincode-finder tool

Online Pincode Finder

Best tool to locate post Office address and pincodes of all india...