Announcement

Collapse
No announcement yet.

How to convert a string to date?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to convert a string to date?

    Hi:

    I am confused with the date field. I have the following html code for a birthdate, and I want to same it to a date field in a table:
    <td>Birth Date: <input type="text" name="birthdate" size="8" maxlength="8"> ex. 19910101</td
    ....
    mysql_query("INSERT INTO studentname (birthdate) values ('$_POST[birthdate]')";

    Now I got error saying:

    Error: Incorrect date value: '20000212'

    Please help to fix it. Should I do some conversion? How do I do it?

    Thank you for your help.

  • #2
    Re: How to convert a string to date?

    Thank you, I fixed the problem.

    Comment

    Working...
    X