Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Date format in php using regular expression

Tags:

regex

php

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?

like image 218
JAMES Avatar asked Jun 08 '26 22:06

JAMES


1 Answers

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'));
like image 74
Joyce Babu Avatar answered Jun 10 '26 12:06

Joyce Babu