I am creating a game where i need the user to enter a deadline time using a jquery dateTime plugin (my PC time) and i save it in the database along with the current time using php (server time).. Then i run a cron (on the server time) where i need the difference of these two times for further work. but there is a logical error here.
I checked and the difference between the times was of 10 hours and 3 mins. so i adjusted that but this will give a logical error if it is used from some other place,, as teh jquery will pick up their PC time and php will pick the sever time.
what should i do?
If you want to get more logical results you should be aware of different timezones.
On the JavaScript site you can use
Date.getTimezoneOffset()orDate.toUTCString();See the following links for example:
JavaScript getTimezoneOffset()
JavaScript toUTCString()