-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
(The original issue was at dotnet/coreclr#45), but I've moved it over here as the meat of the issue is about framework design.
From @mj1856
I would like to propose that DateTime.Now be deprecated. This is most developer's first introduction to working with time, and is also a root cause of bugs related to daylight saving time and time zones.
Developers should get in the habit of thinking globally, rather than locally - especially when designing for the web. Even on desktop and mobile applications that only run in a single time zone, this can create the kind of bugs that pull developers out of bed at 2AM on the morning of a daylight saving time transition.
More supporting arguments:
- The Case Against DateTime.Now - Matt Johnson (me)
- What's Wrong with DateTime Anyway - Jon Skeet
Given the widespread nature of this API, I suggest not removing it from coreclr - but rather marking it with an [Obsolete] attribute. I can send a PR if the suggestion is approved.