﻿function formatTime(DateObj) {
    var theDate = new Date(DateObj);
    var returnstring = "";
    var hours = 0;
    var minutes = 0;
    var ampm = "AM";
    if (theDate.getHours() > 12) {
        hours = theDate.getHours() - 12;
        ampm = "PM";
    } else if (theDate.getHours() == 0) {
        hours = 12;
        ampm = "AM";
    } else {
        hours = theDate.getHours();
    }
    minutes = theDate.getMinutes();

    if (hours < 10)
        hours = "0" + hours;

    if (minutes < 10)
        minutes = "0" + minutes;

    returnstring = hours + ":" + minutes + " " + ampm;
    return returnstring;
}

function formatDate(DateObj) {
    var theDate = new Date(DateObj);
    //alert(theDate);
    return (theDate.getMonth() + 1) + "/" + theDate.getDate() + "/" + theDate.getFullYear();
}  
