Simple Date Output

by scurrilus

JavaScript

var now = new Date(),
		year = now.getFullYear(),
    month = now.getMonth(),
    date = now.getDate(),
    day = now.getDay(),
    arrMonth = new Array(12),
    arrWeekDay = new Array(7);
    
    // Month Names
    arrMonth[0] = "Januar";
    arrMonth[1] = "Februar";
    arrMonth[2] = "März";
    arrMonth[3] = "April";
    arrMonth[4] = "Mai";
    arrMonth[5] = "Juni";
    arrMonth[6] = "Juli";
    arrMonth[7] = "August";
    arrMonth[8] = "September";
    arrMonth[9] = "Oktober";
    arrMonth[10] = "November";
    arrMonth[11] = "Dezember";
    
    // Week day Names
    arrWeekDay[0] = "Montag";
    arrWeekDay[1] = "Dienstag";
    arrWeekDay[2] = "Mittwoch";
    arrWeekDay[3] = "Donnerstag";
    arrWeekDay[4] = "Freitag";
    arrWeekDay[5] = "Samstag";
    arrWeekDay[6] = "Sonntag";
    
    var totalDate = arrWeekDay[day] + " " + date + ". " + arrMonth[month] + " " + year;
    document.write(totalDate);