请想象一下以下情况:
我在亚速尔群岛有个日期(格林尼治标准时间1)2010年10月23日23:00:00
我想将此日期转换为以下日期( GMT +1)
24/10/2010 01:00:00
我希望在任何时区的任何日期都有这种行为,对于这种情况,带有timezone的date函数会给出GMT -1。
请注意,我使用的是JodaTime。
谢谢。
发布于 2012-09-13 22:26:02
DateTime dateTime = new DateTime(2010, 10, 23, 23, 0, 0, 0, DateTimeZone.forOffsetHours(-1)); // (GMT -1) 23/10/2010 23:00:00
DateTime inAnotheTimeZone = dateTime.withZone(DateTimeZone.forOffsetHours(1));https://stackoverflow.com/questions/12408481
复制相似问题