function GetTodayDate() { var tdate = new Date(); var dd = ("0" + tdate.getDate()).slice(-2); var MM = ("0" + (tdate.getMonth() + 1)).slice(-2); var yyyy = tdate.getFullYear(); var xxx = yyyy + "." + MM + "." + dd + "."; return xxx; }
Forrás(ok): StackOverflow