Geeks With Blogs
Saqib Ullah BootStrapper Know How

Whenever guys want to get date in JavaScript they use the following pattern and prepare the current date.
 

 

var currentTime = new Date()

var month = currentTime.getMonth() + 1

var day = currentTime.getDate()

var year = currentTime.getFullYear()

 

document.write(month + "/" + day + "/" + year)

 


Note: - Use following pattern of code

 

var currentDate  = new Date();

 

 

 

Posted on Tuesday, April 19, 2011 11:33 PM Web Tech | Back to top


Comments on this post: Get Complete Date in JavaScript

# re: Get Complete Date in JavaScript
Requesting Gravatar...
Much better way of getting new Date in JavaScript
Left by zafa on Apr 25, 2011 1:20 AM

# re: Get Complete Date in JavaScript
Requesting Gravatar...
tari mano atho
Left by Chhodina on Feb 28, 2014 12:21 AM

Your comment:
 (will show your gravatar)


Copyright © Saqib Ullah | Powered by: GeeksWithBlogs.net