1
回答
Joda Time 提示 Illegal instant due to time zone offset transition (Asia/Shanghai)
终于搞明白,存储TCO原来是这样算的>>>   
public class JodaDemo {

	public static void main(String[] args) {
		Date date = DateTimeFormat.forPattern("yyyy-MM-dd").parseDateTime("1940-06-03").toDate();
		System.out.println(date);
	}
}

Exception in thread "main" java.lang.IllegalArgumentException: Cannot parse "1940-06-03": Illegal instant due to time zone offset transition (Asia/Shanghai)
 at org.joda.time.format.DateTimeParserBucket.computeMillis(DateTimeParserBucket.java:336)
 at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:672)
 at JodaDemo.main(JodaDemo.java:12)

请教一下,这个问题是什么样解决呢?谢谢各位。

举报
NJ123
发帖于6年前 1回/1K+阅
顶部