[英]Why iOS 10 Calendar.current.timeZone not return my local timezone?
In iOS 10, Calendar.current.timeZone
returns GMT
. 在iOS 10中, Calendar.current.timeZone
返回GMT
。 While in iOS 11, Calendar.current.timeZone
returns my local timezone, which is correct. 在iOS 11中, Calendar.current.timeZone
返回我的本地时区,这是正确的。
Is that a bug in iOS 10? 这是iOS 10中的错误吗? How to workaround it? 如何解决呢?
The calendar.timezone returns the UTC. calendar.timezone返回UTC。 You need to convert UTC into Eastern time or your specific timezone. 您需要将UTC转换为东部时间或您的特定时区。
https://www.worldtimebuddy.com/utc-to-edt-converter https://www.worldtimebuddy.com/utc-to-edt-converter
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.