![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ios时间转换
光速之年
Talk is cheap. Show me the code
展开
-
ios日期格式转换
1、如何如何将一个字符串如“ 20110826134106”装化为任意的日期时间格式,下面列举两种类型: NSString* string = @"20110826134106"; NSDateFormatter *inputFormatter = [[[NSDateFormatter alloc] init] autorelease]; [inputFor转载 2015-06-07 20:34:32 · 634 阅读 · 0 评论 -
IOS 世界标准时间UTC /GMT 转为当前系统时区对应的时间
- (NSDate *)getNowDateFromatAnDate:(NSDate *)anyDate { //设置源日期时区 NSTimeZone* sourceTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"UTC"];//或GMT //设置转换后的目标日期时区 NSTimeZone* destin转载 2015-06-07 20:08:35 · 1087 阅读 · 0 评论 -
iOS-获取当前时间的年、月、日、时、分、秒
01 //获取当前时间 02 NSDate *now = [NSDate date]; 03 NSLog(@”now date is: %@”, now); 04 05 NSCalendar *calendar = [NSCalendar currentCalendar]; 06 NSUInteger unitFlags = NSYearCalendarUn原创 2015-05-02 13:03:33 · 1833 阅读 · 0 评论