DateTime的Kind属性始终返回Unspecified [英] DateTime's Kind property always returns Unspecified

查看:353
本文介绍了DateTime的Kind属性始终返回Unspecified的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在即时"窗口中使用了以下代码:

?Date.UtcNow.Kind
未指定{0}
?Date.SpecifyKind(Date.UtcNow,DateTimeKind.Utc ).种类
未指定{0}

我正在使用VS 2008,.NET 3.5 SP1.我完全感到困惑.除了Kind属性的Unspecified值,我什么也找不到.

I used the following code in Immediate window:

?Date.UtcNow.Kind
Unspecified {0}
?Date.SpecifyKind(Date.UtcNow,DateTimeKind.Utc).Kind
Unspecified {0}

I am using VS 2008, .NET 3.5 SP1. I am completely confused. No way was I able to get anything except the Unspecified value for the Kind property.

推荐答案

立即窗口不正确.看起来像在即时窗口中的VB表达式评估器中的错误.请随时在 https://connect.microsoft.com/VisualStudio/feedback/上打开问题.我没有在Visual Studio 2010中尝试过此操作.

最诚挚的问候
Johan Stenberg
The immediate window is incorrect. Looks like a bug in the expression evaluator for VB in the immediate window. Feel free to open an issue at https://connect.microsoft.com/VisualStudio/feedback/. I haven't tried this in Visual Studio 2010.

Best regards
Johan Stenberg


这篇关于DateTime的Kind属性始终返回Unspecified的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆