Bug 1337 - DateTime.Now not correct
Summary: DateTime.Now not correct
Status: RESOLVED DUPLICATE of bug 2167
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2011-10-07 08:35 UTC by Sergey Pachkov
Modified: 2011-12-09 12:10 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Sergey Pachkov 2011-10-07 08:35:07 UTC
in this year Russia changes rules for daylight switch

redhat/microsoft delivers an update for timezone rules and everything correct in OS except mono!

today Mono will return wrong local time (-1 hour). I have checked it with 2.6.7 and 2.10.2.

but when I set local time to 2012 year Mono returns correct time.

short solution is to set TZ=MSK-4 in environment before launch a Mono application.
Comment 1 Sergey Pachkov 2011-10-07 08:35:31 UTC
to get local time I use System.DateTime.Now
Comment 2 Sergey Pachkov 2011-10-07 08:54:21 UTC
after switch to Summer Time in 2011 year Russian break a switch to winter time and fixed timezone.
ex Moscow has +4 TZ

but mono/C# DateTime.Now returns +3 TZ (w/o difference of the year)
Comment 3 Jeffrey Stedfast 2011-12-09 12:10:50 UTC

*** This bug has been marked as a duplicate of bug 2167 ***