php change date entered format to proper format
Posted: Thu Apr 28, 2011 4:29 pm
hi everyone.
i'm wondering how i could modify the code below in order to change the date that's entered in the textbox from any date a user inputs eg 28-04-2011, or 28/04/2011 to the proper format of 2011-04-28 (yyyy-mm-dd) and if its text or a number, just clear the data in the textbox. any ideas?
i'm wondering how i could modify the code below in order to change the date that's entered in the textbox from any date a user inputs eg 28-04-2011, or 28/04/2011 to the proper format of 2011-04-28 (yyyy-mm-dd) and if its text or a number, just clear the data in the textbox. any ideas?
Code: Select all
<?php if ($Date != "0000-00-00") echo $Date; ?>