Facebook outputs dates in ISO8601 format - e.g.: 2011-09-02T18:00:00
Using PHP, how can I reformat into something like: Friday, September 2nd 2011 at 6:00pm
Nb - I was doing it in Javascript, but IE has date bugs so I want a cross-browser solution.
A fast but sometimes-unreliable solution:
$date = '2011-09-02T18:00:00';
$time = strtotime($date);
$fixed = date('l, F jS Y \a\t g:ia', $time); // 'a' and 't' are escaped as they are a format char.
Format characters detailed here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With