0

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.

Mann
  • 5,477
  • 6
  • 45
  • 57
  • See here. Not sure whether to call this a dup, but a good answer here anyway: http://stackoverflow.com/questions/1238838/uiimagepickercontroller-and-extracting-exif-data-from-existing-photos – danh Mar 06 '14 at 16:49

1 Answers1

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"]];
Community
  • 1
  • 1
Avt
  • 16,927
  • 4
  • 52
  • 72