简体   繁体   English

DateTime.Now现在用于DST

[英]DateTime.Now accounts for DST

My DateTime object is assigned the local time using DateTime.Now. 我的DateTime对象使用DateTime.Now分配了本地时间。 I wanted to know if this object will give the correct current local time once Daylight time begins/ends. 我想知道一旦夏时制开始/结束,此对象是否将提供正确的当前本地时间。 Or do I need a workaround? 还是我需要解决方法?

Yes, DateTime.Now is based on the local machine time. 是的, DateTime.Now基于本地计算机时间。

Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time. 获取一个DateTime对象,该对象设置为此计算机上的当前日期和时间,表示为本地时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM