标签:其他 ace 日期 兼容问题 date ios replace 兼容 time
ios中js通过getMonth()获取到的日期显示NaN,而在其他地方如pc、安卓都是ok的,这是为什么呢,原来这里有个ios的兼容问题,需要将日期中的“-”替换为“/”
var time = new Date("2017-6-21 18:00:00".replace(/-/g,‘/‘));
alert(time.getMonth())//都可以正常显示“6”了
标签:其他 ace 日期 兼容问题 date ios replace 兼容 time
原文地址:http://www.cnblogs.com/kevinxue/p/7059303.html