Java Date Conversion - UTC to Local - works differently depending on the timezone
问题 I'm experiencing a problem when converting strings to a UTC data, and then to various timezones. It appears that my program behaves differently depending on whether I convert to EST or PST. Here is my code: SimpleDateFormat utcFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); utcFormat.setTimeZone(java.util.TimeZone.getTimeZone("UTC")); Date date = utcFormat.parse("2014-08-18 17:00:17"); SimpleDateFormat localFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); localFormat.setTimeZone