Hi, My user enters a UK into a text box on the web page. If they enter 05/01/2007 PHP will think it's the 1st may, when it's 5th January. so formatting the text as full month names will display the wrong month. How can I tell PHP that the first part is the day, then the month etc. Thanks
Have the day, month and year in select/drop down boxes. Then join them at the end $publish_day = $_POST['publish_day']; $publish_month = $_POST['publish_month']; $publish_year = $_POST['publish_year']; $publish_date_combine = $publish_year . '-' . $publish_month . '-' . $publish_day; $publish_date = strtotime($publish_date_combine); PHP: Then when you want to output the data again just do $date = date('d-m-Y', $publish_date); PHP:
or try this $arrDate = explode('/',$dateField); date('F d, Y', mktime(0,0,0 $arrDate[1], $arrDate[0], $arrDate[2]); Note: assuming $dateField is the value of the field coming from the post