NSURL* urlToDocumentsFolder = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
__autoreleasing NSError *error;
NSDate *installDate = [[[NSFileManager defaultManager] attributesOfItemAtPath:urlToDocumentsFolder.path error:&error] objectForKey:NSFileCreationDate];
//转为字符串
NSDateFormatter*df = [[NSDateFormatter alloc]init];
[df setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSString *timeString = [df stringFromDate:installDate];
注意: 覆盖安装时, app安装日期不会更改.
目前项目中是通过版本号判断的是否覆盖安装. 暂无其它更好的办法, 有更好的方法欢迎评论哦!