nsdate * senddate=[nsdate date];
nsdateformatter *dateformatter=[[nsdateformatter alloc] init];
[dateformatter setdateformat:@"yyyymmdd"];
nsstring * locationstring=[dateformatter stringfromdate:senddate];
nslog(@"locationstring:%@",locationstring);
[dateformatter release];
格式:yyyy-mm-dd hh:mm:ss