Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2005

Tip: Looking for answers? Try searching our database.

Weird DateTime Regional Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark Irvine - 18 Mar 2005 13:37 GMT
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
Ignus Fast - 18 Mar 2005 15:42 GMT
   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

> Hi,
>
[quoted text clipped - 15 lines]
>
> Mark
Mark Irvine - 18 Mar 2005 16:05 GMT
Hi,

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

Mark

>    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...
[quoted text clipped - 20 lines]
>>
>> Mark
Mark Irvine - 21 Mar 2005 11:26 GMT
Hi,

Problem solved:

http://www.codeproject.com/script/comments/forums.asp?forumid=12076&select=10621
83&tid=1062183#xx1062183xx


Mark

> Hi,
>
[quoted text clipped - 28 lines]
>>>
>>> Mark

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.