Formatting a date string when the string sits inside another string

Posted by sf on Stack Overflow See other posts from Stack Overflow or by sf
Published on 2010-03-25T18:10:26Z Indexed on 2010/03/25 18:13 UTC
Read the original article Hit count: 852

Hi,

I'm trying to figure out a way to format a date string that sits inside string using javascript.

The string can be:

"hello there From 2010-03-04 00:00:00.0 to 2010-03-31 00:00:00.0"

or

"stuff like 2010-03-04 20:00:00.0 and 2010-03-31 00:00:02.0 blah blah"

I'd like it to end up like:

"stuff like 4 March 2010 and 31 March 2010 blah blah"

Does anyone have any idea as to how this could be achieved?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about string