關於日期問題的 求解答 求鞭撻 求滴蠟!解决方法
发布时间:2010-05-30 01:23:14 文章来源:www.iduyao.cn 采编人员:星星草
關於日期問題的 求解答 求鞭撻 求滴蠟!!!!!!!!!
小弟想做一個頁面時間的小東西
計時器已經做好了
下面這個方法就是得到當前的系統時間的
我頁面有一個lable
我打印又能打印出來。。。。。。。。。
但是我怎麼設置不進去lable的值了?????
求解啊!!!!!!!!!!大神們
- (NSString*)get_system_today_time
{
NSDate *date = [NSDate date];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateStyle:kCFDateFormatterMediumStyle];
[formatter setTimeStyle:kCFDateFormatterShortStyle];
[formatter setDateFormat:@"YYYY-MM-dd-hh-mm-ss"];
NSString *string_time = [formatter stringFromDate:date];
NSArray *time = [string_time componentsSeparatedByString:@"-"];
int value_year = [[time objectAtIndex:0]intValue];
int value_month = [[time objectAtIndex:1]intValue];
int value_day = [[time objectAtIndex:2]intValue];
int value_hour = [[time objectAtIndex:3]intValue];
int value_minute = [[time objectAtIndex:4]intValue];
int value_second = [[time objectAtIndex:5]intValue];
[formatter setDateFormat:@"EEEE"];
NSString *week_day = [formatter stringFromDate:date];
[formatter release];
lable_year.text = value_year;
NSString *system_time = [[NSString alloc] initWithFormat:@"{"year":"%d","month":"%d","day":"%d","hour":"%d","minute":"%d","second":"%d","week_day":"%@"}",value_year,value_month,value_day,value_hour,value_minute,value_second,week_day];
NSLog(@"nsystem time is %@",system_time);
return [system_time autorelease];
}
------解决方案--------------------
就是嘛。。。做人要厚道,你的街贴率。。。。艾
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
图片拾取器问题
用图片拾取器方法除了能拾取相册里面的图片外,能不能拾取其它文件里面非照片的图像啊,如果能,要怎么做
------解决...
-
请教个问题。。很弱智,不要嘲笑。。
请问mac osx 10.6下开发出来的程序在mac osx 10.5下可以正常使用么?会不会有些库的问题?
客户要...
-
一个数组可以放UIButton,那怎么调用这些元素呢,[array objectatindex i]不好用]
UIButton,那怎么调用这些元素呢,[array objectatinde...
-
关于imageView显示图片的问题
我现在需要在一个imageView中现在两张图片,这两张是重叠显示的,在android中,我这么做到的,imageView1.s...
-
如何在软件中嵌套ppt播放功能
如何在软件中嵌套ppt播放功能 不知道这个能实现吗
------解决方案--------------------
可以,...
-
objectivc-c
请问下自学obj-c要看哪本书比较好?
linux下可以运行obj-c的程序吗?
mac软件开发除了obj-c还需要什么别的吗?
------解...
-
怎么实现iphone客户端软件与服务器端的数据交互?
怎么实现iphone客户端软件与服务器端的数据交互?
------解决方案---------------...
-
求IOS微信界面实现思路
如题,请大神们指点一二,非常感谢!
------解决方案--------------------
问题过于笼统,无法作答
------解决...
-
给黑苹果搞个Navicat for SQLite 求个下载地址
给黑苹果搞个Navicat for SQLite 求个下载地址 谢谢
------解决方案---------...
-
iphone中按提示弄音频接收, 在线等
关于iphone中的音频接收( Streaming Live or On-Demand Video from IIS7 to iOS Devices (iPhon...