-1

Sorry, I am beginner in Js. In my input, the format date is as this below

example

I would like to change the format jj-mm-aaaa to jj/mm/aaaa. (I just want to change the dash to a slash).

Do you think it's possible?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
joel
  • 21
  • 5

1 Answers1

-1

You could use a regular expression:

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

or you might like to use a string to array conversion joined again to a string:

sDate = sDate.split('-').join('/');
Duck
  • 76
  • 4