tags:

views:

594

answers:

4

Why on one system would the default time be 12:00:00 and on another 00:00:00

DateTime.Now.Date

Starting with string in a web ui, passing thru Nhibernate to SQL Server 2005. For example 6/10/2009 is entered in a textbox on a web server by the time it is caught in sql profiler I see 2 different times

00:00:00 on my local system (XP), Dev, Test, Staging (2003) 12:00:00 on Prod (2003)

Thanks for the quick replies

Regional settings and DateTime format are the same.

+10  A: 

Regional/display settings for date/time formats

Matt Lacey
A vague answer to a vague question. Could you expand on how these would produce that type of behavior?
tvanfosson
more fun to make people guess
Matthew Whited
tvanfosson: the time (and date) formats can be configured to display on a per machine basis. If the machiens were configured to be in different timezones 'now' would also be different.
Matt Lacey
SQL Profile is showing time is back to 00:00:00 today... adding a globalization tag to system.web in prod and will continue to investigate. Thanks for the ideas.
chris
+5  A: 

In the control panel, you can define the way it displays in regional settings:

H:mm:ss -> 24 hours you will see 00:00

h:mm:ss -> 12 hours format with am/pm you will see 12:00 am

tekBlues
I hope you right! Hard to believe we haven't caught this before... Thanks
chris
+5  A: 

It's always midnight, the display might be affected by the machine's local culture settings.

You might be interested in the Turkey Test for a whole slew of other things that can be affected by culture, like parsing doubles, formatting dates and times, etc.

Jeff Moser
+3  A: 

12 hour vs 24 hour clock

Stevo3000