i came across a strange behaviour of iOS 8.2 safari while converting datetime strings to unix ms timestamps during DST transition. Let's say we have js code
function date2unix(dates){
var len = dates.length;
var result = [], arr;
while(len--) {
arr = dates[len].split(/[- :]/);
result[len]= (new Date(arr[0], arr[1]-1, arr[2], arr[3],arr[4],arr[5]).getTime());
}
return result;
}
var dates =
["2015-03-29 00:00:00","2015-03-29 00:15:00","2015-03-29 00:30:00","2015-03-29 00:45:00","2015-03-29 01:00:00","2015-03-29 01:15:00","2015-03-29 01:30:00","2015-03-29 01:45:00","2015-03-29 03:00:00","2015-03-29 03:15:00","2015-03-29 03:30:00","2015-03-29 03:45:00"];
alert(date2unix(dates))
iOS 8.2 Safari gives ambiguous values (1st == 5th, 2nd == 6th, ...) while chrome 41.0.2272.101 behaves correctly. Note that disputed 2nd hour was omitted in array dates. Could anyone help me with finding workaround, please?
Try: http://jsfiddle.net/q6vd0fos/
Regards