Javascript Date getFormatedDateTime()

Description

Javascript Date getFormatedDateTime()


//date.js/*from  w w w. ja va2  s . com*/
Date.prototype.getFormatedDateTime = function() {
    var timeFormatOptions = {  weekday: "short", year: "numeric", month: "short",
    day: "numeric", hour: "2-digit", minute: "2-digit" };
        return this.toLocaleTimeString("en-us", timeFormatOptions);
};



PreviousNext

Related