iOS 从时区获取地点值

标签 ios timezone

当我从我的应用打印这个时:

NSLog(@"%@", [NSTimeZone localTimeZone]);

日志显示:

Local Time Zone (Europe/London (GMT+1) offset 3600 (Daylight)) 

Local Time Zone (US/Eastern (GMT-4) offset -14400 (Daylight))

有没有只返回位置的接口(interface)?例如欧洲/伦敦美国/东部?我真的不想解析结果字符串。

最佳答案

尝试

NSLog(@"Time zone : %@",[[NSTimeZone localTimeZone] name]);

关于iOS 从时区获取地点值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23654777/

相关文章:

php - DateTime 对象上的不同 timezone_types

php - 更新 mysql 时区并更改所有 TIMESTAMPS 列

ios - 在 iphone 模拟器上使用 UIImagePickerController

c# - 如何设置 DateTime 值的时区(或种类)?

ruby - 未初始化的常量 ActionView::CompiledTemplates::Timezone

Java Calendar.roll over DST 开始/结束的值不正确

ios - 订阅 RACSignal 问题

ios - UITextView KeyboardAppearance 属性设置 UIKeyboardAppearanceDark

ios - OpenCV Swift 项目

ios - UIView animateWithDuration 返回原始状态