I've got a Java web application in which the client sends timestamped data to the server to be stored in a MySQL database and retrieved later. These timestamps should always be treated as local time and never adjusted for timezone: If a client in one timezone inputs a time of 18:00:00, it should display for a client in another timezone as 18:00:00.
The database column holding this value is of type DATETIME, as I was under the impression that it does no timezone-adjusting. The java application receives timestamps as java.util.Date objects, and converts them to java.sql.Timestamp objects before inserting them in PreparedStatements. Somewhere along the way however, the time values are getting offset when the client and server are in different time zones.
To give you an idea of what I'm looking for, I could store all my timestamps as strings and that would be exactly the effect I want, but it doesn't make sense to me to have to format and parse strings as dates when they need to be operated on.
What is the usual way to handle such applications when timestamp values should always be treated as local time?