thooyork / thooClock

jQuery analogue AlarmClock Plugin
MIT License
30 stars 17 forks source link

Server time instead of client time #9

Closed yangar closed 6 years ago

yangar commented 9 years ago

I ve seen in the startClock function that the script initialize the date: theDate = new Date(); I try to manually change this date but the clock is not running. Is it possible to initialize the clock with specified date ?

I worked a bit on to get the client timezone with JavaScript and send it to the server to get the appropriate hour correction. But the time can be wrong if the client time is not well set.

Any suggestion ?

BroadcastVision commented 7 years ago

You can add a timezone using moment.js Check here my solution: https://github.com/thooyork/thooClock/issues/11