You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
解析不出来 约定时间格式为时间戳
发自我的iPhone
在 2021年3月4日,10:30,wayne <notifications@github.com> 写道:
iOS和mac使用的JSC引擎的时间格式只支持ISO时间格式,日期与时间之间用T分隔:
var time = "2021-02-19 05:02:28";
time = time.replace(/\s/, 'T');
time = new Date(time).getTime();
console.log(time);
在维基百科中,国际标准ISO 8601 时间格式相关解释如下:
年由4位数字组成YYYY,或者带正负号的四或五位数字表示±YYYYY。以公历公元1年为0001年,以公元前1年为0000年,公元前2年为-0001年,其他以此类推。应用其他纪年法要换算成公历,但如果发送和接受信息的双方有共同一致同意的其他纪年法,可以自行应用。
月、日用两位数字表示:MM、DD。
只使用数字为基本格式。使用短横线"-"间隔开年、月、日为扩展格式。
在 macOS 下 Safari 中,将时间字符串中日期分隔符 - 改成 / 斜杠分割也能识别:
console.log(new Date('2021/02/19 05:02:28’))
// Fri Feb 19 2021 05:02:28 GMT+0800 (CST)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#3641 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFR667URKPQ3JLEW27B7NU3TB3WE3ANCNFSM4YR56V7A>.
第688天 以下时间处理在IOS上会遇到什么问题?如何解决?
3+1官网
我也要出题
The text was updated successfully, but these errors were encountered: