views:

35

answers:

2

Hi guys,

I recently bought some webspace with dailyrazor.com. I have deployed an application I have been working on to the server and am currently trying to workout the bugs but I can't seem to solve this one.

I have set up my database in Visual Studio to use the one I have create with dailyrazor the same db the deployed version will use.

I am using British Dates and on my localhost datetime is displayed: 27/05/2010 09:00 However on the dailyrazor host it is displayed: 5/27/2010 9:00 AM

Short Dates e.g. 27/04/2010 display the same on both servers.

This is causing some issues when entering data as errors occur on date fields.

Any help would be appreciated.

Thanks,

Jon

+1  A: 

Have u tried setting globalization in the web.config file:

   <configuration>
       <system.web>
         <globalization culture="en-GB" uiCulture="en-GB" />
       </system.web>
    </configuration>
Luis
Thank you this worked. I did read somewhere it could be due to localisation settings on the server as I'm using an American host. However I wasn't sure how to set this in web config thanks for your help.
Jonathan Stowell
A: 

I had the same problem once, whenever I tried to send data to procedures for comparison, I'd get an error.

I solved this by removing the special characters date has, the '/' and '-'.

You have two options though, you can either always pass the short date format, or you can do as I did, pass the date without anything else.

For example:

For 2010-04-27, pass '20100427'. This ensures that any other option or collation is replaced, and the date is inserted correctly.

You can get dates formated from Date's ToString method in .NET.

Hope I helped.

Felipe Fiali