Just wondering can we get Time stamp of photo clicked by camera of iOS device using iOS SDK? I've checked here on SO could not find any reference but if i check native PHOTOS app in iPhone photos are grouped by Date. So i wonder there should be a way to get time of photo clicked.
Asked
Active
Viewed 389 times
1 Answers
1
You should read how to retrieve ALAsset
s.
An ALAsset represents a photo or a video managed by the Photos application.
And then call
NSDate *date = [asset valueForProperty:ALAssetPropertyDate];
to receive last modification date. SO question
To take creation date from Exif use:
NSDateFormatter *dateFormatter = [[NSDateFormatter new] autorelease];
dateFormatter.dateFormat = @"y:MM:dd HH:mm:ss";
NSDate *date = [dateFormatter dateFromString:[[[[asset defaultRepresentation] metadata] objectForKey:@"{Exif}"] objectForKey:@"DateTimeOriginal"]];