如何在没有时区对话的情况下解析时间?
How to parse time without timezone conversation?
我正在将 xs:datetime
解析为 joda DateTime
,但想在没有时区的情况下解析它,并让日期+时间保持不变。
我怎样才能做到这一点?以下减去时区,但这不是我想要的。
ISODateTimeFormat.dateTimeParser().parseDateTime("2015-10-25T08:45:00.000+11:00"); //2015-10-24 23:45:00 WHY?
使用正确的时间类型:
LocalDateTime ldt =
ISODateTimeFormat.dateTimeParser().parseLocalDateTime("2015-10-25T08:45:00.000+11:00");
System.out.println(ldt); // 2015-10-25T08:45:00.000
我正在将 xs:datetime
解析为 joda DateTime
,但想在没有时区的情况下解析它,并让日期+时间保持不变。
我怎样才能做到这一点?以下减去时区,但这不是我想要的。
ISODateTimeFormat.dateTimeParser().parseDateTime("2015-10-25T08:45:00.000+11:00"); //2015-10-24 23:45:00 WHY?
使用正确的时间类型:
LocalDateTime ldt =
ISODateTimeFormat.dateTimeParser().parseLocalDateTime("2015-10-25T08:45:00.000+11:00");
System.out.println(ldt); // 2015-10-25T08:45:00.000