Javascript Date getMinutesTwoDigits()

Description

Javascript Date getMinutesTwoDigits()


Date.prototype.getMinutesTwoDigits = function()
{
    var retval = this.getMinutes();
    if (retval < 10)
    {//from   ww w. j a v a 2  s.c  om
        return ("0" + retval.toString());
    }
    else
    {
        return retval.toString();
    }
};



PreviousNext

Related