Converting date string from dashes to forward slashes

前端 未结 3 1811
长情又很酷
长情又很酷 2021-01-25 04:57

I am trying to convert my dashed date 2013-12-11 to 2013/12/11 using the following function:

function convertDate(stringdate)
{
    // Internet Explorer does not         


        
3条回答
  •  既然无缘
    2021-01-25 06:01

    Use String Replace to replace the dashes with slashes.

    string.replace(/-/g,"/")
    

提交回复
热议问题