Moh*_*shi 4 nsdate nstimezone ios swift swift3
我想在Swift 3中获取用户的当前日期和时区.我在Swift 2.2中尝试了以下代码:
static var localTimeZoneAbbreviation: String { return NSTimeZone.localTimeZone().abbreviation!}
Run Code Online (Sandbox Code Playgroud)
Nir*_*v D 11
为了得到abbreviation从NSTimeZone.
static var localTimeZoneAbbreviation: String { return NSTimeZone.local.abbreviation(for: Date())! }
Run Code Online (Sandbox Code Playgroud)
获得最新信息Date.
let currentDate = Date()
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12616 次 |
| 最近记录: |