RE: [PHP] Date format
| From: | Warren Vail | Date: | Mon, 07 Apr 2003 19:33:37 +0000 |
| Subject: | RE: [PHP] Date format | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142741@lists.php.net to get a copy of this message | ||
Try;
$mysqldate = date("Y-m-d",strtotime($userdate));
and check out the manual at
http://www.php.net/manual/en/function.strtotime.php
the strtotime function will interpret a wide variety of formats fairly
reliably
good luck,
Warren Vail
warren@vailtech.net
-----Original Message-----
From: Bomgardner, Mark A [mailto:mbomgardner@kletc.org]
Sent: Monday, April 07, 2003 12:20 PM
To: Php-general@lists.php.net (E-mail)
Subject: [PHP] Date format
List people:
I aploogize if this issue has been resolved in the past, but I am new to php
and I could find an answer in the archives.
Problem:
I have a form that a user inputs a date (mm/dd/yyyy) and I want to convert
that to the mysql date yyyy-mm-dd so it can be inputed in to the database.
I have tried the date() command with no luck and I am out of options to try.
I can get the date out of mysql once it gets there, but putting it into the
correct format has been a problem.
Any help would be greatly appreaciated.
Mark Bomgardner
ex-lasso person
new php person
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php