Saqib Ullah

BootStrapper Know How

  Home  |   Contact  |   Syndication    |   Login
  111 Posts | 1 Stories | 871 Comments | 15 Trackbacks

News



Article Categories

Archives

Post Categories

Blogging websites

Favourite Blogs

Private Links

Sites

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

Feedback

# re: Get Complete Date in JavaScript 4/25/2011 1:20 AM zafa
Much better way of getting new Date in JavaScript

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: