Safari on iOS is probably one of the best mobile browsers. Still there is one thing that I often got wrong and wonder why my webapp doesn’t work.
In every normal browser you could just create a Date object from string as
var myDate = new Date('2013-01-21T13:46:20');
But on iOS this simply gives you a JS error.
To fix it you should use the good ol’ split() and do something like this
//First we split the date string var iosDateArr = '2013-01-21T13:46:20'.split('[- :T]'); //And use the constructor with 6 args cDate = new Date(arr, arr-1, arr, arr, arr, arr);
Note that the Month in the array is reduced by one. This is because the Months are counted from 0 for January to 11 for December.