Java与IOS日期格式

1 //JAVA日期格式
2 Date date = new Date();
3 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
4 String dateTime = dateFormat.format(date);

 

1 //IOS日期格式
2 NSDate *date = [NSDate date];
3 
4 NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
5 formatter.dateFormatter = "@yyyy-MM-dd hh:mm:ss";
6 NSString *string = [formatter stringFromDate:date];

 

posted @ 2013-10-05 13:49  wangzhenxiang  阅读(830)  评论(0编辑  收藏  举报