NSDateFormatter用来设置NSDate的格式

-(NSString *)descriptionspa

{orm

    NSDateFormatter *formatter=[[NSDateFormatter alloc]init];ip

    [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; //用来设置NSDate的输出格式字符串

    NSString *setTime=[formatter stringFromDate:self.time];string

    NSString *setTime=[formatter stringFromDate:[NSDate date]];//用来说本地时间转换成字符串的形式输出it

    return [NSString stringWithFormat:@"\ntitle:%@\ntime:%@\ncontents:%@\n",self.title,setTime,self.contents];io

}form

相关文章
相关标签/搜索