Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

MySQL Date field

  • 21-11-2005 12:16AM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 1,464 ✭✭✭evilhomer


    Have you tried the PHP manual???

    Manual


  • Registered Users, Registered Users 2 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