Forum Moderators: coopster
To a unix timestamp?
I dont even know what kind of date structure that is (i am getting that value from a rss autogenerated file).
explode part1 on - gives yyyy mm dd
trim final char from part2
explode part2 on : gives hh mm ss
feed all of that into mktime
result is a timestamp
Alternatively you could also use strtotime [php.net].
Andrew
you might have to strip the T and Z, not sure, try it out
$d = '2007-01-26T09:26:07Z'; $d = str_replace('T',' ',$d); $d = str_replace('Z',' ',$d); echo strtotime($d);
does it work?
is this optimized?
What version of PHP are you using?