var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
To get time and date you should use
new Date().toLocaleString(); >> "09/08/2014, 2:35:56 AM"
To get only the date you should use
new Date().toLocaleDateString(); >> "09/08/2014"
To get only the time you should use
new Date().toLocaleTimeString(); >> "2:35:56 AM"