Search code examples
c#datetimedst

DateTime.Now accounts for DST


My DateTime object is assigned the local time using 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?


Solution

  • Yes, DateTime.Now is based on the local machine time.

    Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time.