|
|
Question : input dd/mm/yyyy date format in MSAccess entered as mm/dd/yyyy how to avoid?
|
|
I am getting date format as dd/mm/yyyy in asp while inserting in access database it is inserted as mm/dd/yyyy since the server in USA.
How to insert data as it is in dd/mm/yyyy format?
Help me out please.
|
Answer : input dd/mm/yyyy date format in MSAccess entered as mm/dd/yyyy how to avoid?
|
|
Dateformat is a nice thing.
Using asp, you have: 1. the browser, where the user types in a date in a certain dateform. 2. the ASP which captures the string and can convert it to a date, but can also pass the string along to the database. 3. the database which stores the date in its own way.
Important is where the conversion from string to date takes place. If it is done by ASP, then the ASP the conversion uses the regional setting of ASP. <%=Session.LCID%>.
If the string-to-date conversion is done by the database, then the database regional setting are being used. Furthermore, ACCESS is "clever". If it needs date-strings in format "mm/dd/yyyy", but it gets "14/02/2002", then it still creates a date: "14 February 2002". <%=connection.Properties("Locale Identifier")%>
When all regional setting are the same, there is no problem. The problem arises when there are differences in regional settings. And the problems are not always that easy to solve.
Getting the dat back from the database: 1. the database gives a date to ASP (no conversion, except when explicitely asked for) 2. ASP then formats the date according to the regional settings and displays it.
Depending on where your problem is, and where the string-to-date conversion takes place, you need a different solution.
Please show the code how you insert the dates in the database.
|
|
|
|
|