Add tags

Add tags to the following comment
var t = new Date();
print(DatetoString(t))
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function DatetoString(t){
    return (""
        + paddingLeft(t.getFullYear(), 4, '0')
        + paddingLeft(t.getMonth()+1, 2, '0')
        + paddingLeft(t.getDate(), 2, '0')
        + paddingLeft(t.getHours(), 2, '0')
        + paddingLeft(t.getMinutes(), 2, '0')
        + paddingLeft(t.getSeconds(), 2, '0')
        + "."
        + paddingLeft(t.getMilliseconds(), 3, '0')
    );
}

if(!String.prototype.x){
    String.prototype.x = function(n){
        var result="", i;
        for(i=0;i<n;i++){
            result += this;
        }
        return result;
    }
}
function paddingLeft(str, d, c){
    var len  = str.toString().length;
    var x = d > len ? d - len : 0;
    
    return c.x(x) + str;
}

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...