Vote count:
0
the timezone will change ,when i put different seconds in dateWithTimeIntervalSince1970: method here is the code :
NSDateFormatter* dateFormat = [[[NSDateFormatter alloc] init] autorelease];
[dateFormat setDateFormat:format];
[dateFormat setTimeZone:[NSTimeZone localTimeZone]]; //Asia/shanghai +8:00
int64_t timestamp = 714880800 ;// 683258400
NSDate* date = [NSDate dateWithTimeIntervalSince1970:timestamp];
NSString *str = [dateFormat stringFromDate:date];
I make timestamp = 714880800 first time,and then 683258400,but the result is that:
so ,if there is something i missed?
asked 33 secs ago
dateWithTimeIntervalSince1970 method return wrong date
Aucun commentaire:
Enregistrer un commentaire