Weird DateTime Regional Problem

M

Mark Irvine

Hi,

I have a web service that records the status of our engineers, e.g on route,
on site, departed or abort current job. This uses DateTime.Now.ToString("F")
to record when each of the above actions are completed. On my dev server,
W2K3 enterprise, SQL Server 2000 (SP3) and all regional settings set to UK,
everything works fine. However when I deployed the service on our production
machine, running W2K3 Std, SQL Server 2000 (SP3) and all regional settings
set to UK, some - but not all, of the date are in the US long date format.
This breaks some of database inserts. I have checked and double checked the
regional settings on the server and source devices and they are all set to
UK.

As a temp fix I added Thread.CurrentThread.CurrentCulture = new
CultureInfo("en-GB") to each affected methods.

Is there something I'm missing? Has anyone experienced a similar problem?

Mark
 
I

Ignus Fast

Why wouldn't you use a database TODAY type command directly in the SQL
INSERT command instead of generating it in code first? Just curious...

Ignus
 
M

Mark Irvine

Hi,

The app may operate in a disconnected environment, so the datetime at insert
may not be the correct one.

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top