how to convert dd mm yyyy to mm dd yyyy in javascript
Solution:
var date = "24/09/2012";
var datearray = date.split("/");
var newdate = datearray[1] + '/' + datearray[0] + '/' + datearray[2];
newdate will contain 09/24/2012. The split method will split the
string wherever it finds a "/", so if the date string was "24/9/2012",
it would still work and return 9/24/2012.
No comments:
Post a Comment