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?

0

2 Answers 2

8

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'));
Sign up to request clarification or add additional context in comments.

Comments

2

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);;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.