我有应用程序,我在其中使用 NSDate 并将其保存在 NSString 但 NSString 存储 000.000 像这样这里是我正在使用的代码
NSDate* date = [NSDate date];
NSDateFormatter* formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd HH:MM:SS"];
NSString* str = [formatter stringFromDate:date];
NSString*content_AddedTime=str;
NSString *post =[[NSString alloc] init];
post = [NSString stringWithFormat:@"userId=%@&catalogID=%@&content_AddedTime=%@&organizationCode=%@",userId,catalogID,content_AddedTime,organizationCode];