PDA

View Full Version : MySql date format/php form



onemhunki
June 8th, 2006, 05:17 AM
Hi folks,

I've got a PHP form to edit a record in a database, I need the user to be able to enter the date in the european format, ie: 30/11/06. I can get the date to display in this way using the Unix Timestamp but the database will not interperet this this way and displays a random date format.

Any help/advice on this topic as usual greatly appreciated.

Ta.

Ben Smith
June 8th, 2006, 11:09 AM
When you enter the date into the database, make sure it's


$date = strtotime($entereddate);

That way, PHP changes it into a timestamp.
Then, you can call a date function when you need to view the date

onemhunki
June 9th, 2006, 04:15 AM
Thanks for the help. I'll give strotime a go.

Thanks