//获取系统时间
NSDate * date=[NSDate date];
NSDateFormatter *dateformatter=[[NSDateFormatter alloc] init];
[dateformatter setDateFormat:@"HH:mm"];
NSString * locationString=[dateformatter stringFromDate:date]; //[dateformatter setDateFormat:@"YYYY-MM-dd-HH-mm-ss"];
//NSString * morelocationString=[dateformatter stringFromDate:senddate]; //获得系统日期
NSCalendar * cal=[NSCalendar currentCalendar];
NSUInteger unitFlags=NSDayCalendarUnit|NSMonthCalendarUnit|NSYearCalendarUnit;
NSDateComponents * conponent= [cal components:unitFlags fromDate:senddate];
NSInteger year=[conponent year];
NSInteger month=[conponent month];
NSInteger day=[conponent day];
NSString * nsDateString= [NSString stringWithFormat:@"%4d年%2d月%2d日",year,month,day]; [dateformatter release];