事件日志中的 UTCDate?转换为正确的语言环境
我正在使用 WMI 读取 Windows 事件日志,并且最近注意到,如果我将 cim 日期时间转换为 .NET,时间会落后。日期时间似乎被编码为 UTC。 .NET 中应该有直接的转换,不是吗?
I am reading windows eventlog using WMI and just noticed recently that time is lagging behind, if I convert cim datetime to .NET. It seems that datetime is encoded as UTC. There should be straighforward conversion in .NET, isn't it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试 date.ToLocalTime() 将 UTC 日期/时间转换为本地日期/时间。
You might try date.ToLocalTime() to convert an UTC date/time to local date/time.