Hi,
I have a date, in european format, dd/mm/yyyy. Is there a way for me to convert this to a timestamp?
thanks
Hi,
I have a date, in european format, dd/mm/yyyy. Is there a way for me to convert this to a timestamp?
thanks
Fair few ways TBH.
$timestamp = strtotime(str_replace('/', '-', '25/12/2010'));
echo date('r', $timestamp); #Sat, 25 Dec 2010 00:00:00 +0000
$timestamp = strtotime(vsprintf('%s-%s-%s', explode('/', '25/12/2010')));
echo date('r', $timestamp); #Sat, 25 Dec 2010 00:00:00 +0000
$timestamp = mktime(null, null, null, substr('25/12/2010', 3, 2), substr('25/12/2010', 0, 2), substr('25/12/2010', 6, 4));
echo date('r', $timestamp); #Sat, 25 Dec 2010 00:00:00 +0000
Thanks for that Anthony