Split and rearranging Date
I am currently trying to split a date i'm getting and rearrange it.
At the moment the date is shown like this in my html:
but I need to rearrange it to
to be able to use it and get more information from my json file, does anyone know how to do this?
Thanks in advance,
var $date = '15-09-2001';
$date = $date.replace(/(\d+)-(\d+)-(\d+)/, '$3/$2/$1');
Last edited by Kor; 01-05-2011 at 11:04 AM.
Neat. Except that you should have explain to Bey a little bit more about RegExp. You gave him the fish, ok, but you should have given him the rod, as well
Originally Posted by thraddash
LOL! I was going to say the same thing. The rod and some fishing lessons.
Originally Posted by Kor
Ah, yes. The whole "Teach a man to fish" routine. My Appologies.
I would like to know more about this technique as well, if someone would please indulge those of us who are ignorant on this.
Thanks for both the fish and the rod! now I can practise, the link you gave me is a good guide.
Oops! Missed that link. Sorry, ignore my last post.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)