Mysql/ASP populate forms with wrong dateformat

When the tableformat datetime are loaded into a form (..input type="text"..), it loads as "1/1/2007".
I checked within the mysql table, the dates are stored with the format "2007-01-01", which is the format I want.
The exactly same (ASP) script and form are showing the dates in correct format on my development computer.
The wrong format appear when running it on the customers webhosting.

A little wierd problem that I need some help with.

I've search and found some "conversion scripts" but this is hard to implement because I use sub routines for populating the forms, that does not take care if there are a date, text or integer. Shouldn't there be an easy solution to this? Like setting a codepage or like that??
LVL 1
dingirAsked:
Who is Participating?
 
dingirAuthor Commented:

Session.LCID = 1053

(for swedish)
In the top of the page, did it all. Thank's a lot, I found that answer myself.
0
 
MorcalavinCommented:
I don't understand why you can't call a format function from a subroutine.  Whenever you insert your date, just run this(say you are doing a response.write):
<%
response.write formatMyDate(Now())

function formatMyDate(myDate)
      formatMyDate = Cstr(DatePart("yyyy",myDate)) & "-" & Cstr(DatePart("m",myDate)) & "-" & Cstr(DatePart("d",myDate))
end function
%>
0
 
dingirAuthor Commented:
morcalavin,
Thank's for answer!
You mean that manipulating the output is the only way to solve the problem?
If the answer is yes, I will past some code..
0
 
Vee_ModCommented:
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.