I am taking a value entered by a user in a jQuery UI datepicker and converting it to a to a php date for insertiion in a database like so:
$date_from = post('date_valid_from');
$date_from = date('Y-m-d', strtotime($date_from));
This works fine if the input is formatted in US format (mm/dd/yyyy), however as my system will be used by people in the UK it needs to be input in the UK format (dd/mm/yyyy). When converting the UK dates to a php date, the month and day are switched around (Feb 1 2014 - 01/02/2014 - becomes January 2 2014 and Feb 28 2014 - 28/02/2014 - becomes January 1 1970).
Is there anyway I can overwrite the default date format to work with UK format?
(This project is using Code Igniter if there is a CI config setting I can set)