I have a simple form in php that basically asks what ‘time’ a user wants a certain task performed. They choose the date and time such as 11-15-2010 12:30 pm.
I can get this data into php, convert it to a timestamp, and in theory, run this task at that specific time. My concern however is that the time I run the task will be different then the actual desired time of the user and what they entered, depending on their timezone relative to mine (or my servers).
If this makes sense, does anyone have any ideas or something I’m missing that would make this work and run the task at the desired and correct time?
If it has to happen in sync with the user’s time, you could use JavaScript to insert the user’s system time into the form and pass it along, then calculate the relative server time based on that.
or just put on the form the server’s time, and let the user adjust their desired time themselves. (Which may be better if they require minute-specific timing)
Instead of trying to use JavaScript to get the user’s timezone and then trying to make a guess at what the user might want to do. Why not just ask them what they want? Put a timezone field for example. Just ask if they want a specific timezone to be used or the default server timezone.