-(NSString*)changeNumToTime:(NSString*)str { NSDate *date = [NSDate dateWithTimeIntervalSince1970:[str integerValue]/1000]; NSDateFormatter *dateFor.....
分类:
其他好文 时间:
2015-09-23 18:50:22
阅读次数:
149
NSDate 和 NSDateFormatter;--获取当前时间: NSDate *now = [NSDate date]; NSTimeZone *zone = [NSTimeZone systemTimeZone]; NSTimeInterval interval = [zone second...
分类:
移动开发 时间:
2015-09-22 12:54:20
阅读次数:
224
NSArray *weekdayAry = [NSArray arrayWithObjects:@"星期日", @"星期一", @"星期二",@"星期三", @"星期四", @"星期五", @"星期六", nil]; NSDateFormatter *formater =[[NSDateForma....
分类:
移动开发 时间:
2015-09-21 14:10:47
阅读次数:
207
1 NSDate *senddate=[NSDate date];2 NSDateFormatter *dateformatter=[[NSDateFormatter alloc] init];3 [dateformatter setDateFormat:@"YYYYMMddHHm...
分类:
其他好文 时间:
2015-09-19 18:16:59
阅读次数:
156
常用代码片断,只为了便于记忆日期格式转换 // 设置数据模型的时间 NSDate *now = [NSDate date]; NSDateFormatter *fmt = [[NSDateFormatter alloc] init]; fmt.dateFormat = @"H...
分类:
移动开发 时间:
2015-09-19 15:22:36
阅读次数:
148
//实例化一个NSDateFormatter对象NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];//设定时间格式,这里可以设置成自己需要的格式[dateFormatter setDateFormat:@"yyyy-MM-...
分类:
移动开发 时间:
2015-09-15 21:53:53
阅读次数:
141
之前有篇博客是使用NSDateFormatter来对时间进行格式化输出,但使用起来有点繁琐,今天介绍下最近刚刚使用的SimpleDateFormat.1 public class SimpleDateFormat extends DateFormat日期和时间模式日期和时间格式由日期和时间模式字符串...
分类:
编程语言 时间:
2015-09-13 18:33:37
阅读次数:
288
NSString *dateString=@"2015-09-30";NSDateFormatter *dateFormatter=[[NSDateFormatter alloc]init];[dateFormatter setDateFormat:@"yyyy-MM-dd"];myData = [...
分类:
其他好文 时间:
2015-09-07 22:26:43
阅读次数:
172
1.时间或者日期格式化的格式化,在真机上运行的是hi,必须指定是在哪个区域的,不然在真机无法显示 // 1.日期格式化 NSDateFormatter *fmt = [[NSDateFormatter alloc] init]; fmt.dateFormat = @"EEE MMM dd HH...
分类:
移动开发 时间:
2015-09-04 17:08:37
阅读次数:
186
NSDateFormatter分类: iOS平台前言:iOS开发中NSDateFormatter是一个很常用的类,用于格式化NSDate对象,支持本地化的信息。与时间相关的功能还可能会用到 NSDateComponents类和NSCalendar类等。本文主要列出NSDateFormatter常见用...
分类:
其他好文 时间:
2015-09-04 14:14:44
阅读次数:
158