I want to get current date and time zone of user in Swift 3. I tried in Swift 2.2 following code :
static var localTimeZoneAbbreviation: String { return NSTimeZone.localTimeZone().abbreviation!}
For getting abbreviation
from NSTimeZone
.
static var localTimeZoneAbbreviation: String { return NSTimeZone.local.abbreviation(for: Date())! }
For getting current Date
.
let currentDate = Date()
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