How do I get the raw offset in milliseconds for Coordinated Universal Time in iOS programmatically?
NSInteger millisecondsFromGMT = 1000 * [[NSTimeZone localTimeZone] secondsFromGMT];
In Swift 3 and Swift 4:
let millisecondsFromGmt = 1000 * TimeZone.autoupdatingCurrent.secondsFromGMT()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With