Easy question begat convoluted answer....

by Michael S. Kaplan, published on 2011/07/05 07:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2011/07/05/10183038.aspx


Rich's question was straightforward enough:

Hello,

The product I work on needs to run on .Net 2 but our test harness needs to run on .Net 4.  These are hard restrictions and we can’t get around them due to dependencies.


When I run the following code on .Net 2.0 and .Net 4.0, I get different outputs.
DateTime now = DateTime.Now;
CultureInfo ci = new CultureInfo("it-IT", false);

Console.Write(now.ToString("T", ci));

The operating systems seem to have different values as well, though the .Net behavior will be the same on either OS.   Does anyone know what is correct time format is and where this is defined?

Server 2008 SP2:

Server 2008 R2 SP1:

I suppose this question just helps to prove that the question being straightforward isn't much of an indicator for whether the answer will be.

Where should we start?

In the end, the only surprising fact is that the scenario ever "worked" -- failure can eventually be pretty much guaranteed....


jader3rd on 5 Jul 2011 9:54 AM:

After reading a lot of posts on "The Old New Thing" one tidbit has been impressed on me; the fact that Microsoft's biggest problem may be how to communicate the fact that things which "worked" weren't supposed to, and now that they're fixed, it's actually a good thing.

John Cowan on 18 Jul 2011 8:07 AM:

Indeed, sometimes bug-for-bug compatibility is the Wrong Thing, and sometimes it's the Right Thing, and sometimes people think it's the Wrong Thing when it's really the Right Thing, and sometimes ... you get the idea.  Backward, turn backward, O Time, in your flight ....


go to newer or older post, or back to index or month or day