views:

19

answers:

1

Is it possible to change a setting somewhere in Visual Studio (2008 or 2010, in my case) to change the default display of a DateTime to 24 hour in the autos, locals, and watch windows?

For example, I have a DateTime corresponding to July 17, 2010 at 1:00 PM. Visual Studio displays this in the watch window as #7/17/2010 1:00:00PM#. I would like it to display something closer to #7/17/2010 13:00:00#.

A: 

Change your Regional and Language settings in Windows. This is where Visual Studio is pulling the formats for displaying the date. Change the long and short date formats to suit. In your case, move to a format where there's no tt placeholder.

I've only tested this in the Watch window so far.

alt text

alt text

p.campbell
This is exactly the solution I was looking for. Unfortunately, it looks like the appropriate settings are only available in Windows Vista/7. When I tried this on an XP box, the clock format changed, but Visual Studio still displayed the date in 12 hour format. More firepower to upgrade the development machines in my office!
Doug