Originally Posted by Old Pedant
Yes, jmrker, but your script depends on (a) the users' computer clocks being set correctly and (b) the users being in the same time zone as the server [though it's easy to adjust for the latter].
See how I pass the server time in, from PHP, and then use the discovered offset in all other calculations.
Yes, and if my battery dies, my watch is only right twice a day.
I, for one, do not worry about other's clock settings in JS.
I would rely on the server's clock, much like you have done, if it is that important.
I also left the logic available to adjust for MST using UTC and/or the gettimezone() function. I'm not in MST so I left that as an exercise for the student.