Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

MySQL Date field

Options
  • 21-11-2005 12:16am
    #1
    Registered Users Posts: 673 ✭✭✭


    Hey,

    Am i correct in saying that mysql has to store the date in the format 0000-00-00.

    I am using a html form to get users to input when they are holding tournament. I am currently asking them to input the date in the format yyyy-mm-dd to suit mysql. Is their a way around this.

    When i want to display this data on my site i want it in the format dd-mm-yyyy. How do i do this?

    Thanks for your help


Comments

  • Registered Users Posts: 1,464 ✭✭✭evilhomer


    Have you tried the PHP manual???

    Manual


  • Registered Users Posts: 673 ✭✭✭Bananna man


    I'm using one at the moment but i've skiped ahead a bit and so am a bit lost. I check what it said about the date function at www.php.net but that wasnt much use for what im asking about.


  • Closed Accounts Posts: 291 ✭✭kstanl


    Generally I'll use three select boxes side-by-side... the first is for the day (1-31) the second is for month (1-12) and the third is for year (1900-2050 or whatever the year range is). Once the user submits the form, all you need to do is insert the date as: Request("year") & "-" & Request("month") & "-" & Request("year")

    Be sure to remember to update the 'day' select box using DOM script if necessary depending on what month is selected (30 days hath September, April June and November - all the rest have 31 except for February alone! :D )


Advertisement