// date = the current date and time
// day = the current amount of days that have passed in the month
// dayName = the current amount of days passed in the week -1
// displayDay = the current days in "Monday, Tuesday" format
// year = the current year in CCYY format
// month = the current number of months passed in the current year
// displayMonth = the current months in "january, February" format
// hours = the current hour of the day
// minutes = the current minutes that have passed this hour
// ampm = am or pm depending if its morning or afternoon
// displayDateTime = [Example: Date: Jan 17, 2002, 14:29PM]


var date = new Date();

var year = date.getYear()
if (year < "2000") { year = parseInt(year) + 1900}

var day  = date.getDate();


var dayName  = date.getDay();
switch (dayName) {
    case 0 :
        displayDay = "Sunday"
        break
    case 1 :
        displayDay = "Monday"
        break
    case 2 :
        displayDay = "Tuesday"
        break
    case 3 :
        displayDay = "Wednesday"
        break
    case 4 :
        displayDay = "Thursday"
        break
    case 5 :
        displayDay = "Friday"
        break
    case 6 :
        displayDay = "Saturday"
        break

    default: displayDay = "INVALID"
}



var month = date.getMonth();
switch (month) {
    case 0 :
        displayMonth = "January"
        break
    case 1 :
        displayMonth = "February"
        break
    case 2 :
        displayMonth = "March"
        break
    case 3 :
        displayMonth = "April"
        break
    case 4 :
        displayMonth = "May"
        break
    case 5 :
        displayMonth = "June"
        break
    case 6 :
        displayMonth = "July"
        break
    case 7 :
        displayMonth = "August"
        break
    case 8 :
        displayMonth = "September"
        break
    case 9 :
        displayMonth = "October"
        break
    case 10 :
        displayMonth = "November"
        break
    case 11 :
        displayMonth = "December"
        break

    default: displayMonth = "INVALID"
}




//----------TIME-------------------------------------------------------------------------

var hours = date.getHours()
var minutes = date.getMinutes()
if (minutes <10) {"0"+ minutes}
var ampm = "AM"
if (hours > 11) {
ampm = "PM"
}

//------------- EXAMPLE ------------------------
displayDateTime = displayMonth+ "&nbsp;"  + day + ",&nbsp;" + year + ",&nbsp;" + hours + ":" + minutes + ampm
TwoLinesDateTime = displayMonth + "&nbsp;" + day + ",&nbsp;" + year 
//January 2002, 15:36PM  + "<BR>" + hours + ":" + minutes + ampm