tags:

views:

97

answers:

4

I have the following string: 2010-04-08T12:46:43+00:00

I want to convert that to:

8th April 2010 @ 12:46

Is that easy enough?

A: 

Try taking a look at strtotime() and date().

Amber
+2  A: 

Take a look at strtotime to create a UNIX timestamp from your time string, and then use date($format, $UNIXtimestamp); to create a normal date again:

$Timestamp = strtotime("2010-04-08T12:46:43+00:00");
echo date("your time format", $Timestamp);

You can look up the specific characters for the time format from PHP.net

Hans
and as always stackoverflow feed newbies with complete solutions so they ask their manual questions more and more.
zerkms
The "complete solutions" get accepted, folks want points so provide "complete solutions" to get accepted…
salathe
+1  A: 

yep. use strtotime() + date()

zerkms
Because your right, I'll never learn.
danit
+1  A: 

Here you go.

EDIT : Exactly as you needed

Code:

$time_value = strtotime("2010-04-08T12:46:43+00:00");
$date_in_your_format = date( 'jS F Y @ g:i', $time_value);  
echo $date_in_your_format;
Devner