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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.