Javascript String toAmericanDateTime()

Description

Javascript String toAmericanDateTime()

String.prototype.toAmericanDateTime = function() {
    if ( "" == this )
        return ""

    var date_part = this.split("T")[0].split("-");
    var hour_part = this.split('T')[1].split(":");

    return date_part[1] + "/" + date_part[2] + '/' + date_part[0] + ' ' + hour_part[0] + ":" + hour_part[1];
}



PreviousNext

Related