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

php5 formatting date problem

Options
  • 02-03-2006 8:42pm
    #1
    Registered Users Posts: 742 ✭✭✭


    $sql2 = "INSERT INTO Booking_Info (Date_Booked, Start_Date, End_Date, Number_Guests, Cot_Required, Cust_Username) VALUES ('".$today."', '".$startdate."', '".$enddate."', '$number', '$cot', '".$username."')";

    hi,

    is there anyway to format startdate and enddate before they enter the database?????

    im trying to enter 03/11/2006(march 11th) as the startdate but it goes into the database as 2003/11/20

    the date is coming from my javascript popup calendar

    cheers


Comments

  • Registered Users Posts: 927 ✭✭✭decob


    Loco wrote:
    $sql2 = "INSERT INTO Booking_Info (Date_Booked, Start_Date, End_Date, Number_Guests, Cot_Required, Cust_Username) VALUES ('".$today."', '".$startdate."', '".$enddate."', '$number', '$cot', '".$username."')";

    hi,

    is there anyway to format startdate and enddate before they enter the database?????

    im trying to enter 03/11/2006(march 11th) as the startdate but it goes into the database as 2003/11/20

    the date is coming from my javascript popup calendar

    cheers

    substr is your friend.

    substr($startdate,6,4) . "/" . substr($startdate,3,2) . "/" . substr($startdate,0,2);


  • Registered Users Posts: 742 ✭✭✭Loco


    cheers fixed :) im sure ill have more problems soon


Advertisement