0
设置在日期字段时区,我使用JodaTime2库创建日期对象与给定的时区为:如何使用jodatime库
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
DateTimeZone tz = DateTimeZone.forID("America/New_York");
System.out.println("timezone=" + tz);
Date d = new DateTime(2013, 1, 1, 0, 0, tz).toDate();
System.out.println("Cur Date = " + d);
然而,当我打印此日期,报告的时区是CST。我错过了什么?
timezone=America/New_York
Cur Date = Tue Jan 01 13:00:00 CST 2013
谢谢@Jon Skeet – lava