【发布时间】:2015-05-29 12:16:51
【问题描述】:
我的数据库将所有日期时间值存储为 UTC 字符串。当我看字符串时,它们是这样的
2013-05-28T01:38:13.000Z
根据documentation,'Z' 代表时区偏移量。由于“Z”之后没有任何内容,这是否意味着没有偏移量,因此它代表 UTC 时间?
-
如果是,我还需要在构造函数中指定 TimeZone 吗?由于字符串似乎已经这样做了(说它是 UTC 时间)?
DateTime myDate = new DateTime("2013-05-28T01:38:13.000Z", DateTime.UTC);
第二个参数是必须的吗? 谢谢。
【问题讨论】:
标签: java datetime timezone jodatime utc