摘要: 目录[-]iOS时间那点事NSTimeZone基本概念:由方法理解NSTimeZoneNSTimeZone的属性变量(猜想):代码实例:时区对时间的影响添加中国标准时间名称缩写夏天了!注意夏时制!本系列其他文章不断更新中:iOS时间那点事NSTimeZone**时区是一个地理名字,是为了克服各个地区... 阅读全文
posted @ 2015-10-26 16:24 luqinbin 阅读(255) 评论(0) 推荐(0) 编辑
摘要: iOS时间那点事NSDateFormatterNSDateFormatter是NSFormatter的子类,另,NSFormatter的用途是“将数据在字符串与特定类型的对象之间转换”,目前NSFormatter只有两个子类NSNumberFormatter和NSDateFormatter。尽管NS... 阅读全文
posted @ 2015-10-26 14:49 luqinbin 阅读(462) 评论(0) 推荐(0) 编辑
摘要: 目录[-]iOS时间那点事NSCalendar + NSDateComponentsNSDateComponents实例化的方式第一种:第二种:第三种:NSCalendar中比较重要的方法和概念firstWeekday-(NSRange)rangeOfUnit:(NSCalendarUnit)sma... 阅读全文
posted @ 2015-10-26 14:48 luqinbin 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 其他方法的说明- (NSRange)maximumRangeOfUnit:(NSCalendarUnit)unit;返回单元的最大范围。就Gregorian来说有:NSEraCalendarUnit => 0 - 2NSYearCalendarUnit => 1 - 10000NSMonthCale... 阅读全文
posted @ 2015-10-26 13:37 luqinbin 阅读(269) 评论(0) 推荐(0) 编辑
摘要: NSCalendar用于处理时间相关问题。比如比较时间前后、计算日期所的周别等。1. 创建或初始化可用以下方法+ (id)currentCalendar;取得当前用户的逻辑日历(logical calendar)+ (id)autoupdatingCurrentCalendar;取得当前用户的逻辑日... 阅读全文
posted @ 2015-10-26 13:36 luqinbin 阅读(483) 评论(0) 推荐(0) 编辑