Timestamps and time zone conversions in Java and MySQL
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm developing a Java application with a MySQL database on a server located in a different time zone from mine, and I am trying to decide between using DATETIME or TIMESTAMP on my database. After reading questions like Should I use field 'datetime' or 'timestamp'? , and the MySQL documentation , I decided TIMESTAMP was better for me as it converts values to UTC for storage, and back to the current time zone for retrieval. Also, as user Jesper explains in this thread, java.util.Date objects are internally only a UTC timestamp (i.e. number of