Confused about time value
|
|
CheckScriptForUpdate = {
...
time: new Date().getTime() | 0,
...
}
Why do you bitwise-or the number of milliseconds since 1970-01-01 00:00:00 with 0? I fooled around at the JS console and got this: js> var time = new Date().getTime(); js> time 1242371790835 js> time | 0 1126242291 What does it mean? I don't glark it from context either. |
|
|
It truncates the time to an integer so that I can store it as one. I use to store it as a string but if done consistently I think the current way produces the desired result. I could do the same with:
time>>0 ~~timeYou can read up on obscure operator usage here: http://www.merlyn.demon.co.uk/js-logic.htm#OC |