WeChat Mini Programs's compatibility with ios

var timer = "2018-06-07T03:54:37.000+0000"; / / fixed format returned at backend
timer = timer.replace (/-/ g, "/"); / / No problem with Android without this step. Run
var date1 = new Date (timer);
var years = date1.getFullYear () / / Ios to NaN


Don't talk about Android iOS, it's all wrong on the console on pc.
Resources , my test address
clipboard.png

clipboard.png


NANiosnull

clipboard.png


when I saw what you said, I checked the previous code.
this is not the problem of WeChat Mini Programs. It is that ios does not support the use of'/ 'time to transfer

.
function timeFormat(timeStr){//2017-12-07T18:55:12
    timeStr = timeStr.replace("T"," ").replace(/[-]/g,"/");
    var timestamp = Date.parse(new Date(timeStr));
    return timestamp;
};

studied it again, so that both chrome and safari are feasible.
new Date ('2018-06-07T03new Date (' 54V 37.00000VOV 00')


has it been solved? Ask for help

Menu