0
如何使用NodaTime解析Zoned DateTime字符串?我目前使用LocalDateTimePattern进行解析,但我认为DateTime的值取决于服务器的时区。使用NodaTime解析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。但是,我无法使用它。我错过了什么吗?