I want to parse the Twitter API created_at
value(stored into a variable), which looks like this:
Sun Aug 28 19:31:16 +0000 2011
Into this:
19:31, Aug 28
But I need it to be timezone-aware. Any ideas about how to make this using php
?
After using the second option which John Flatness suggested I'm getting this error:
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() [<a href='datetime.--construct'>datetime.--construct</a>]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Sao_Paulo' for 'BRT/-3.0/no DST' instead' in /misc.php:4
Stack trace:
#0 /misc.php(4): DateTime->__construct('Sun Aug 28 19:3...')
#1 /tabs/home.php(29): format_date(Object(SimpleXMLElement), 'America/Sao_Pau...')
#2 {main}
thrown in /misc.php on line 4