while posting a date from a PHP form, I must enter it as YYYY-MM-DD to be accepted. is there a way I can reformat the date as it POSTS so people can enter it as DD-MM-YYYY?
. date("M d, Y", strtotime($_POST['dob'])); .. or something?
It's running fine
<?php echo date("M d, Y", strtotime('12-06-1982')); ?> output
Jun 12, 1982 UPDATE WITH EXAMPLE
HTML
<form action="date.php" method="post"> <input type="text" name="dob"/> <input type="submit" name="submitDate" value="submit"/> </form> date.php
<?php if ($_POST['submitDate']){ echo date("M d, Y", strtotime($_POST['dob'])); } ?> This will return the date in that format that you want. Simple!