I have input dates always in UK format (dd/mm/yyyy).
I want to convert into a timestamp, but the server timezones are different between dev/staging and production servers.
I want to reliably convert a UK string date into a timestamp. Any ideas? The attached code does not work - I thought it would?
// Force UK date format
date_default_timezone_set('GMT'); // UTC? Europe/London?
$v_test_date = '01/12/2011'; // 1st December 2011 UK format
$o_date = new DateTime($v_test_date);
"Original (UK)" => $v_test_date,
"Formatted (Server)" => $o_date->format('d/m/Y')