shadrxninga Posted November 16, 2011 Share Posted November 16, 2011 I've got this string from an rss feed "2011-11-16T06:05:15Z" , I'm not good a regex at all... I would love to be but I don't have time to learn it at the moment. What I was hoping someone good do was give me some regular expressions that would separate the date out, So I would be able to make 4 variables that contained the following: $year = "2011" $month = "11" $date = "16" $time = "06:05:15" This is so I can then return the string as "16 Nov, 2011 06:05:15" If you know a better way to change the first date to the second one that would also be fantastic, or though I think this will have to require regex. Which is why I am posting it here. Thanks a bunch shadrxninga Link to comment https://forums.phpfreaks.com/topic/251239-separating-a-date-into-4-blocks/ Share on other sites More sharing options...
trq Posted November 16, 2011 Share Posted November 16, 2011 Take a look at strtotime and date. echo date("d M, Y h:i:s", strtotime('2011-11-16T06:05:15Z')); Link to comment https://forums.phpfreaks.com/topic/251239-separating-a-date-into-4-blocks/#findComment-1288638 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.