Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date format problem

Status
Not open for further replies.

stinkybee

Programmer
May 15, 2001
218
GB
I am trying to insert dates into my access database in the format dd/mm/yyyy using an ASP script.

However, it appears to swap the day and month around when inserting the values to mm/dd/yyyy. For example, if I enter 01/03/2006 it will insert 03/01/2006 into the database.

I have set the locale to UK in my asp script and my computer and server are both set for UK date formats. All other access databases on my server work with the correct format.

I can not work out what the problem is, does anyone have a solution for this?

I have also posted this on the ASP forum in case there is a script solution so please do not suggest I post it there.
 
Internally Access uses US date format (mm/dd/yyyy) to interpret incoming dates if there is any ambiguity in the date regardless of the locale settings. For that reason you need to use some unambiguous format such as "01/Mar/2006" or "2006-03-01" (ANSI Standard).
 
Thanks for the answer.

I have converted my dates to ISO format, yyyy-mm-dd before insertion and they now appear correct.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top