Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"... The big PIA is time-syncing in with where you are at the moment ..."

Though I was thinking this fails if your machine has the wrong time.

"... It should now pick up your timezone via js ..."

and you can use this to check against user preferences in TZ. I'll be checking the src how you do this. Difficult to find out how?



JSTZ_OFFSET gets set by the backend from the session:

 var offset = new Date().getTimezoneOffset() / 60
 if(offset != parseInt(JSTZ_OFFSET)){
   new Ajax.Request("/jstz/" + offset);
 }



thanks for the code sample. didn't know JS had a date object. then again there are lot of things I don't know ...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: