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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Problem 1

Status
Not open for further replies.

Mighty

Programmer
Joined
Feb 22, 2001
Messages
1,682
Location
US
I am not really sure if this is the correct forum to post this question in but I will try as it relates to an Access DB. I am having problems with dates being entered in dd/mm/yyyy format on a web form but being stored in mm/dd/yyyy.

I have checked my asp code and the sql command is correct - printed it to the screen. For example, sql command sets a date as 01/09/2007. If I then look at that field in the form again, it shows as 09/01/2007. I downloaded the DB from the host to look at the raw data and it is stored as 09/01/2007 - even though it was inserted as 0/09/2007.

I used to have this website hosted in the US but moved it to Ireland where the date format is different. Anyone have any ideas how I can sort this? I want to be able to insert dates in dd/mm/yyyy format and have them stored as the same.

Mighty
 
Mighty

You've hit on one of the internationalisation stumbling blocks with computers.
If you insert your dates using the ANSI Date format (yyyy-mm-dd, for example 2007-01-09 for 9th January 2007, as opposed to 2007-09-01 which is 1st September 2007)

but then use formatting in your ASP code to display it as you want, it will work regardless of the international settings of the host.
Access uses the international settings of the host to determine how to handle date formats where there are ambiguities.

John
 
That appears to be working - will test it out and hopefully it solves my problems.

Mighty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top