【问题标题】:Get CST Time on spring/summer with JodaTime使用 JodaTime 在春季/夏季获取 CST 时间
【发布时间】:2013-06-08 12:56:13
【问题描述】:

现在是夏天。所以我们开启了 dayLightTime。但是下面的代码没有考虑到它或者在其他方面是错误的。

DateTimeZone dateTimeZone = DateTimeZone.forID("America/New_York");
DateTime dateTime = DateTime.now(dateTimeZone);
System.out.println("Current time is: " + dateTime);

请在您的机器上运行此代码并使用this检查输出

我哪里错了?

【问题讨论】:

    标签: java datetime time timezone jodatime


    【解决方案1】:

    America/New_York 是东部时间。

    对于中部时间,请使用America/Chicago

    【讨论】:

    • 哇!非常感谢!你打开了我的眼睛!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-08-31
    • 1970-01-01
    • 2021-03-27
    • 2017-05-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多