Skip to main content

Aktuelles Datum ermitteln

function getCurrentDate() {
            var today = new Date();
            var dd = (today.getDate() < 10) ? ('0' +  today.getDate()) : today.getDate();
            var mm = (today.getMonth()+1 <10 ) ? ('0' + (today.getMonth()+1)) : today.getMonth()+1;      //January is 0!
            var yyyy = today.getFullYear();
            date = {"dd":dd,"mm":mm,"yyyy":yyyy,"fulldate":dd+"."+mm+"."+yyyy,"fulldateEN":yyyy+"-"+mm+"-"+dd};
            this.date =date
            return date;
        }