Jump to content

Separating a date into 4 blocks.


shadrxninga

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.