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

problem with date format in access database 1

Status
Not open for further replies.

goaganesha

Programmer
Dec 4, 2001
178
BE
Hello,
I'm having troubles with getting a date in the correct format in an accessdatabase. I live in europe and here we display dates like dd/mm/yyyy. I use the now function to get the current datetime and then convert it with this function:
Code:
Function ReturnDateFormat(strDate)
If isDate(strDate) Then
   ReturnDateFormat =  Day(strDate) & "/" & Month(strDate) & "/" & Year(strDate)
Else
   Response.Redirect "../index.asp?content=err_Date"
   Response.End
End If
End Function
this returns the date like 24/02/2005. which is correct.
right before insert the date in the database, i do a response.write and the date is still correct. But if I check the database it is converted to 02/24/2005.

All regional settings on the server are correct and the format in the access database is set to dd/mm/yyyy, but still it is converted. Any solutions?

regards, goaganesha
 
if te date comes back out of the database correctly, does it mater much how it is stored in the interim while no one is looking at it?

barcode_1.gif
 
Thanks for your reply,
no it doesn't matter, but when it comes back out of the database it is displayed in the wrong format and that does matter.
regards, goagansha
 
Try seeting the LCID for your country (Locale ID - alters how currency, dates, etc are formatted by default). Here's a thread covering a similar question: thread333-820425

Hope that helps,
-T

barcode_1.gif
 
ok thanks for your reply. it helped. date is not correct in the database, but it is in the page that gets it back out of the db.
regards, goaganesha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top