you can use joda-time api, the version must be greater than 2.5. When joda-time api updates the db time zone after changing the Russian time zone from version 2.5.
Date timestamp = sdf.parse("11/17/2014 06:13:19"); TimeZone timezone = TimeZone.getTimeZone("Europe/Moscow"); DateTimeZone tz = DateTimeZone.forTimeZone(timezone); DateTime jodaDateTime = new DateTime(timestamp, tz); System.out.println(jodaDateTime.hourOfDay().get());
Hujie shi
source share