Skip to Content
author's profile photo Former Member
Former Member

how to convert " April 25,2005" to the format which it can be inserted

hi all,

how to convert " April 25,2005" date to the format which it can be inserted into database.

respond quickly

regards,

Joshua

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 21, 2005 at 02:28 PM

    A bit more info required.

    What format is required to be passed to the database? Is it ddmmyyyy, mmddyyyy, dd/mm/yyyy, etc?

    From where will you be getting the value "April 25, 2005"? Are you expecting a user to type this into an input field or are you pulling it from a text file in that format or are you getting it like that from the Java date object, etc?

    Respond quickly doesn't sound very polite in English.

    Will you be giving feedback to anyone who responds with an answer this time (so that they or others with the same problem will know if the answer was usefull) or perhaps rewarding points for helpfull answers?

    See Changing the value of the dropdownListBox as per the selection of the previ

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 21, 2005 at 02:30 PM

    Joshua,

    first of all, what exactly are you trying to do? It sounds like you have written some custom java component in which a user can enter a date value. You want to store this date value in a database.

    Is this correct? If so, please give the code that is not working for you.

    Next, some things you might consider worthful for your problem.

    - Store your data value as a java.util.Date object (instead of String) internally. This makes it quite easy to use in an java.sql.PreparedStatement

    - Identity the exact format your database requires data values (e.g. some DBs prefer #yyyy-mm-dd#).

    Lastly, if you ask for "quick responses", please <b>DO </b> provide sufficient information for one to be able to acually answer you...

    Regards,

    Dominik

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.