获得系统时间

来源:互联网 发布:sap sql 编辑:程序博客网 时间:2024/04/28 14:34

NSDateFormatter  *dateformatter=[[NSDateFormatter alloc] init];  

 [dateformatter  setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; 

 NSString*currentTime=[dateformatter stringFromDate:[NSDate date]];

 [dateformatter release];

NSLog(@"currentTime is:%@",currentTime);

结果如下所示:


原创粉丝点击