开发者

Regex: match and replace on a date

I'd like to convert the date separators in a date.

So, from 11.11.2009 -> 11-11-2009

Could so开发者_如何学Cmeone help me do that with a regex?


my_date = my_date.replace(/\./g, '-');


You mean '11.11.2009'.replace(/\./g, '-').

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜