String strDateTime = "2015-08-14 16:25:12"; //From database that was stored in UTC
DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss").withZone(DateTimeZone.UTC);
DateTime dateTime = DateTime.parse(strDateTime, dateTimeFormatter);
LocalDateTime local = dateTime.toLocalDateTime();
// local = 2015-08-14T16:25:12.000
I want to get the date in my local time zone???
where local = 2015-08-14T11:25:12.000 // 11 VS 16
任何想法我在這裏做錯了嗎?這種使用ISO日期時間格式如何解析UTC時間並顯示JodaTime java中的本地時間?