【发布时间】:2013-05-30 06:33:41
【问题描述】:
我们如何使用 NodaTime 解析 Zoned DateTime 字符串?我目前正在使用 LocalDateTimePattern 进行解析,但我认为生成的 DateTime 值将在 服务器的时区中。
var pattern = LocalDateTimePattern.CreateWithInvariantCulture(dateTimePattern);
var parseResult = pattern.Parse(dateTimeString);
if (!parseResult.Success)
{
// throw an exception or whatever you want to do
}
我在查看 ZonedDateTime 模式时遇到了 Noda Time API。但是,我无法使用它。我错过了什么吗?
【问题讨论】: