Forums
This topic is locked
PHP, MySQL, Formatting Dates, & Forms?
Posted 05 Feb 2004 14:09:58
1
has voted
05 Feb 2004 14:09:58 Matt Bailey posted:
I have a form with a text field on it that displays the date currently stored in the database in the European format (DD/MM/YYYY). The PHP code I have used in the text field is below.What can I do to allow the user to enter the date in the European format (DD/MM/YYYY), but have the database recognise the format and convert it correctly (YYYY-MM-DD)? At the moment if you enter the date as 'DD/MM/YYYY' it just generates a random date in the database which bears little resemblance to the date entered.
echo date('d/m/Y',strtotime($row_PressReleasesRS['Date']));