var date = new Date();var str = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate(); alert(str);