I have a HTML form which has a date and time field. I assume that when a user enters a date/time, they are doing so in their local time, but when I store it in the database, I need it in UTC, and then when displaying it I need to adjust it to the viewers time.
Can I know the clients timezone from the server (I am using PHP and Apache, but may use IIS in the future, so would rather not rely on Apache-only behavior if possible)? Or can I do UTC <-> Local conversions on the client in Javascript?
Example:
A user in UTC+1 timezone submits 2012-10-18 01:30
. This should get stored as the timestamp of 2012-10-18 00:30:00
(whatever that is). Then, if a client at UTC-5 with local DST views the record, they should see 2012-10-17 20:30
.