Get todays date in Javascript -


how can current date in javascript in format?

"m/d/yyyy"?

thanks.

if today be

"2/17/2011", if 3rd "2/3/2011".

thanks

var currenttime = new date() var month = currenttime.getmonth() + 1 var day = currenttime.getdate() var year = currenttime.getfullyear() document.write(month + "/" + day + "/" + year) 

i assigned each part own variable example it's more clear returns.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -