alert(dateObj)
gives Wed Dec 30 2009 00:00:00 GMT+0800
How to get date in format 2009/12/30
?
I would suggest you to use Moment.js http://momentjs.com/
Then you can do:
moment(new Date()).format("YYYY/MM/DD");
Note: you don't actualy need to add new Date()
if you want the current TimeDate, I only added it as a reference that you can pass a date object to it. for the current TimeDate this also works:
moment().format("YYYY/MM/DD");