I'm getting an external RSS Feed Post in different website, what I noticed is that they all have a different format of Publish Date. Some uses a formatting like this:
2012-04-09T08:23:07Z
Fri, 06 Apr 2012 01:25:43 0000
There are still lots of format but I was just showing you two examples.
Now, I want everything to have a uniform format, so i'm using strtotime(). Here's my code:
$date = "2012-04-09T08:23:07Z";
date( "F d, Y", strtotime( $date ) );
/* Result: April 09, 2012 */
My problem here is the second format Fri, 06 Apr 2012 01:25:43 0000
There is a 0000 at the last which makes the strtotime() act weird.
$date = "Fri, 06 Apr 2012 01:25:43 0000";
date( "F d, Y", strtotime( $date ) );
/* Result: April 06, 0000 */
Obviously the result should be April 06,2012.
My question here is that how can I not let strtotime() act weird when it detects a format that has a 0000 at the last. Any idea how to do this? Your help would be greatly appreciated! Thanks! :)
Thanks!