Announcement

Collapse
No announcement yet.

2 digit time

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 2 digit time

    I am using sDate += ":" + (today.getMinutes());


    how do I get 2minutes to look like 02 in string?

  • #2
    use a variable to record the minutes, add the 0 as necessary to the variable, and use the variable in place of "today.getMinutes()"
    Like:
    PHP Code:
    var nMin=today.getMinutes();
    if(
    nMin<10nMin="0"+nMin;
    sDate += ":" nMin

    Comment

    Working...
    X