Mysql/ASP populate forms with wrong dateformat

Posted on 2007-10-09
Last Modified: 2008-01-09
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??
Question by:dingir
    LVL 18

    Expert Comment

    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
    LVL 1

    Author Comment

    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..
    LVL 1

    Accepted Solution


    Session.LCID = 1053

    (for swedish)
    In the top of the page, did it all. Thank's a lot, I found that answer myself.
    LVL 1

    Expert Comment

    Closed, 500 points refunded.
    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
    Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now