现在是夏天了。所以我们有dayLightTime。但是下面的代码没有考虑到它或者在其他方面是错误的。
DateTimeZone dateTimeZone = DateTimeZone.forID("America/New_York");
DateTime dateTime = DateTime.now(dateTimeZone);
System.out.println("Current time is: " + dateTime);
请在您的计算机上运行此代码,并使用this
检查输出我哪里错了?
答案 0 :(得分:2)
America/New_York
在东部时间。
对于中部时间,请使用America/Chicago
。