`NSTimeZone+localTimeZone` returns wrong values after default time zone has been changed
Originator: | ilyukevich.victor | ||
Number: | rdar://34507729 | Date Originated: | September 18, 2017 |
Status: | Open | Resolved: | |
Product: | iOS SDK - Calendar | Product Version: | iOS 11 |
Classification: | Bug | Reproducible: | Always |
Area: Calendar Summary: Once a default time zone is set with `NSTimeZone+setTimeZone:` on iOS 11, `NSTimeZone+localTimeZone` keeps forwarding values to the old wrong time zone. Steps to Reproduce: 1. Override default time zone with some new time zone. For example with `NSTimeZone.default = NSTimeZone(forSecondsFromGMT: NSTimeZone.default.secondsFromGMT() + 3600) as TimeZone` Expected Results: That `[NSTimeZone defaultTimeZone].secondsFromGMT` should equal to `[NSTimeZone localTimeZone].secondsFromGMT` Actual Results: `[NSTimeZone localTimeZone]. secondsFromGMT` returns wrong result. It still forwards calls to the previous default time zone (or maybe to a systemTimeZone). Version/Build: Xcode GM (Version 9.0 (9A235)) iOS 11 Configuration: Xcode GM (Version 9.0 (9A235)) iOS 11 The attached file has the unit test showing the problem. Unit test passes when I run against iOS 9 and iOS10, but fails on iOS 11: https://github.com/yas375/ExampleApp/blob/eece3b453507fb8812a2b73e13b38bc7a99a5d56/TimeZonesTests/TimeZonesTests.swift#L24-L25
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!