{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/626","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/626/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/626/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/626/events","html_url":"https://github.com/dotnet/corefx/issues/626","id":56480067,"number":626,"title":"Deprecate DateTime.Now","user":{"login":"ellismg","id":9602953,"avatar_url":"https://avatars.githubusercontent.com/u/9602953?v=3","gravatar_id":"","url":"https://api.github.com/users/ellismg","html_url":"https://github.com/ellismg","followers_url":"https://api.github.com/users/ellismg/followers","following_url":"https://api.github.com/users/ellismg/following{/other_user}","gists_url":"https://api.github.com/users/ellismg/gists{/gist_id}","starred_url":"https://api.github.com/users/ellismg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellismg/subscriptions","organizations_url":"https://api.github.com/users/ellismg/orgs","repos_url":"https://api.github.com/users/ellismg/repos","events_url":"https://api.github.com/users/ellismg/events{/privacy}","received_events_url":"https://api.github.com/users/ellismg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-02-04T04:51:40Z","updated_at":"2015-02-05T09:42:20Z","closed_at":null,"body":"(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.\r\n\r\nFrom @mj1856 \r\n\r\nI would like to propose that [`DateTime.Now`](https://github.com/dotnet/coreclr/blob/ef1e2ab328087c61a6878c1e84f4fc5d710aebce/src/mscorlib/src/System/DateTime.cs#L904-L920) 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.\r\n\r\nDevelopers 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.\r\n\r\nMore supporting arguments:\r\n- [The Case Against DateTime.Now](http://www.codeofmatt.com/2013/04/25/the-case-against-datetime-now/) - Matt Johnson (me)\r\n- [What's Wrong with DateTime Anyway](http://blog.nodatime.org/2011/08/what-wrong-with-datetime-anyway.html) - Jon Skeet\r\n\r\nGiven 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."},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/73019091","html_url":"https://github.com/dotnet/corefx/issues/626#issuecomment-73019091","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/626","id":73019091,"user":{"login":"MartinJohns","id":5269069,"avatar_url":"https://avatars.githubusercontent.com/u/5269069?v=3","gravatar_id":"","url":"https://api.github.com/users/MartinJohns","html_url":"https://github.com/MartinJohns","followers_url":"https://api.github.com/users/MartinJohns/followers","following_url":"https://api.github.com/users/MartinJohns/following{/other_user}","gists_url":"https://api.github.com/users/MartinJohns/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinJohns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinJohns/subscriptions","organizations_url":"https://api.github.com/users/MartinJohns/orgs","repos_url":"https://api.github.com/users/MartinJohns/repos","events_url":"https://api.github.com/users/MartinJohns/events{/privacy}","received_events_url":"https://api.github.com/users/MartinJohns/received_events","type":"User","site_admin":false},"created_at":"2015-02-05T09:42:20Z","updated_at":"2015-02-05T09:42:20Z","body":"@aggsol He is well aware of this. `DateTime.Now` can be bad at some situations (like the one you mentioned), but the point is that it's not *always* bad. There are legitimate uses for it.\r\n\r\n> Let the developer make the decision. Contrary to popular belief we know what we're doing."}}