Reputation: 1629
can you please help me with formatting the following date using PHP
variable $start contains the following date
this date
Wed Feb 01 2012 05:00:00 GMT-080
should become
2012-02-01T13:00:00
I know how to use basic PHP date/time formats, but this one is a bit though-er,
thanks in advance
Upvotes: 0
Views: 468
Reputation:
$d = new \DateTime('Wed Feb 01 2012 05:00:00 GMT-080');
echo $d->format('Y-m-d\TH:i:s');
Upvotes: 2
Reputation: 522616
echo date('Y-m-d\TH:i:s', strtotime('Wed Feb 01 2012 05:00:00 GMT-0800'));
Upvotes: 2