datetime - PHP - RFC3339 date to "friendly" date (google calendar api) -
i need convert date rfc3339 format (that returned google calendar api) format such "1st october, 5pm" in php.
if correct, format rfc3339 is: 2010-12-01t17:00:00.000-02:00
thanks
use php's amazing strtotime
, date
functions.
$rfc = "2010-12-01t17:00:00.000-02:00"; $date = date('js f, ga', strtotime($rfc)); // 1st december, 5pm
update: if have php >= 5.2, can use datetime class.
$rfc = "2010-12-01t17:00:00.000-02:00"; $date = new datetime($rfc); $datestr = $date->format('js f, ga'); // 1st december, 5pm
Comments
Post a Comment