by perlgeek · 15y ago · 0 comments
+new Date() // 1259359833574
Oh come on, magic constants? How do you check if that's the right number? function PrefixInteger(num, length) {
return (num / Math.pow(10, length)).toFixed(length).substr(2);
}
Is there no sprintf in Javascript? Or did I misunderstand what the function does? Number(new Date())
or more simply Date.now()
if you don't need IE8 support.Title: Milliseconds since epoch
+new Date()
1309882329679
+new Date()
1309882331551
+new Date()
1309882332511