View Full Version : Date issues with certain hosting providers...

03-30-2007, 05:18 PM
Hi everyone, I'm wondering if any of you can help.

Currently one of my customers is hosting with a well known company (they will remain nameless for now) and they are really giving me problems with dates.

I already know about LCID's and the different ways of setting them and the such, but my problem is a little stranger than just this.

I have a very simple site whereby administrators can enter news items as and when they need to. My problem being with the dates of these news articles.

When an administrator adds a news item, if the DD part of DD/MM/YYYY is <= 12, the hosting company swap the DD and MM parts BEFORE passing to the database to store so myy date is stored as MM/DD/YYYY.

This would be annoying but simple to work around with a calander control as administrators would not need to know what format the date needs to be in. Using the DoDateTime() function in ASP I can set the LCID so it knows which part is the DD and which is the MM.

However, if the date is > 12, the date (for obvious reasons) doesn;'t get swapped.

For example:

If I want to enter the date 11 march 2007 (UK format) - the database stores 03/11/2007 (UK meaning 3 November or US 11 march)

With the same example, if I enter the same date in US format (march 11 2007) - the database stores 11/03/2007 (UK meaning 11 march or US 3 november)

Even more complicated is when I enter a date such as 13 march 2007 (UK) - the date is stored as 13/03/2007 (UK 13 march or US 3 '13th month').
Again stranger if I enter the date as march 13 2007 (US) - the database stores 13/03/2007 (UK 13 march or US 3 '13 month') - exactly the same.

Does anyone have any idea how I can get around this? The hosting provider are adament that they are helping more because the server is trying to convert the date for me but it's just complicating things.

If anyone needs more information, please let me know and I'll happily send it on. I even have a very basic test page where they have ben able to enter dates to a seperate database with just a date field and a description field to show how the date was entered and how the date is actually stored.

I can pass this URL on to anyone who think they can help.

PS: Does anyone know if I'll get into trouble for posting the hosting companies details on here? If I won't, I'll post the entire email thred for anyone interested.

I'm really getting desperate now.

Thanks in advance,


03-31-2007, 12:35 AM
Sorry I'm not any help here but this is obviously not a uncommon problem: http://www.google.com/search?q=us+uk+date+format&rls=com.microsoft:*&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1