Objective C - 如何使用 NSTimeZone 获取原始偏移量(没有 DST)

Objective C - How to get raw offset (without DST) using NSTimeZone

我想获得 GMT 的原始偏移量。我知道答案可能是这样的:

NSTimeZone *zone = [NSTimeZone timeZoneWithName:@"Europe/Berlin"];
NSInteger *offset = [zone secondsFromGMT];

(像这里:iOS - How to get raw offset for timezone?

但问题是,它没有给我 raw 偏移量(对于柏林 +1),而只有 offset with DST (+2),即为当前日期。

NSTimeZone 有一个 属性 daylightSavingTimeOffset 与原始偏移

的差异 returns
NSTimeZone *zone = [NSTimeZone timeZoneWithName:@"Europe/Berlin"];
NSTimeInterval rawOffset = [zone secondsFromGMT] - [zone daylightSavingTimeOffset];