草庐IT

destinationComponents

全部标签

ios - Swift - 时区关闭一小时/秒 FromGMT 不正确

这应该是一个非常简单的问题,但我似乎无法理解它。鉴于我的时区是美国东部时间(GMT-4),为什么GMT的04:00变成23:00而不是00:00?//Theoffsetis-4hoursletoffsetFromGMT=Calendar.current.timeZone.secondsFromGMT()/60/60//2017-03-1204:00vardestinationComponents=DateComponents()destinationComponents.timeZone=TimeZone(secondsFromGMT:0)destinationComponents.y