[BUG] 微信小程序 IOS 时间转换

描述 小程序ios   new Date('2019-08-14T08:00:00.000+0000')   显示为  <Date: null>.

 

'2019-08-14T08:00:00.000+0000'     转为    Date

new Date('2019-08-14T08:00:00.000+0000'.replace(/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}).*$/, '$1 $2 GMT+0000').replace(/-/g, '/'))
// new Date('2019/08/14 08:00:00 GMT+0000');

new Date('2019-08-14T08:00:00.000+0000'.replace(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}).*$/, '$1Z'));
// new Date('2019-08-14T08:00:00Z');

 

1: +0000 为 标准时间, 东八区为+0800



posted @ 2019-08-14 17:39  whosmeya  阅读(856)  评论(1编辑  收藏  举报