tags:

views:

54

answers:

2

Hai, any can help me to change the "Wed Sep 29 14:47:37 +0000 2010" to "Sep 29,2010 at 2:47PM" using regular expression in PHP?

+8  A: 

You can use strtotime. No need for regular expression.

date('M j, Y \a\t g:i A', strtotime('Wed Sep 29 14:47:37 +0000 2010'));
Joyce Babu
+1  A: 

Use the functions date and strtotime:

$str = 'Wed Sep 29 14:47:37 +0000 2010';
$timestamp = strtotime($str);

echo date('M j, Y', $timestamp).' at '.date('g:i A', $timestamp);;
Thariama
that's why i edited my post
Thariama