摘要: const d = Fri Sep 20 2019 16:37:39 GMT+0800 (中国标准时间); const d = res.data[0].time const resDate = d.getFullYear() + '-' + this.p((d.getMonth() + 1)) + '-' + this.p(d.getDate()) ... 阅读全文
posted @ 2019-09-26 21:08 在学习编程的lsy呀 阅读(1478) 评论(0) 推荐(0) 编辑
摘要: var str = 'Fri Sep 20 2019 16:37:39 GMT+0800 (中国标准时间)'; str = str.replace(/ GMT.+$/, '');// Or str = str.substring(0, 24) var d = new Date(str); var a = [d.getFullYear(), d.getMonth() + 1, d.getDate() 阅读全文
posted @ 2019-09-26 21:01 在学习编程的lsy呀 阅读(2905) 评论(0) 推荐(0) 编辑
摘要: 类型转换主要指,将其他数据类型转换为(String、Number、Boolean)转换为string:方式一:调用xxx的yyy()方法,就是xxx.yyy() var a=123; a.toString(); console.log(a); 结果:123 该方法不会影响到原来的变量,它会将转换的结 阅读全文
posted @ 2019-09-26 20:56 在学习编程的lsy呀 阅读(138) 评论(0) 推荐(0) 编辑