So this cant be too difficult, I need a feed date/time converted into a unix timestamp in PHP.
from "2010-04-13T10:00:00.000-04:00" -> Unix
I have been trying all sorts of weird things with date() and strtotime() with no luck. Thank you!
So this cant be too difficult, I need a feed date/time converted into a unix timestamp in PHP.
from "2010-04-13T10:00:00.000-04:00" -> Unix
I have been trying all sorts of weird things with date() and strtotime() with no luck. Thank you!
$dt=new DateTime("2010-04-13T10:00:00.000-04:00");
echo $dt->format('U');
Try this:
$time = strtotime(preg_replace('/(T|\.\d{3})/', ' ', '2010-04-13T10:00:00.000-04:00'));
Here I used preg_replace
to replace the T
and the milliseconds with single spaces.