Skip to content

Instantly share code, notes, and snippets.

@spoletto
Created March 6, 2014 05:23
Show Gist options
  • Save spoletto/9383098 to your computer and use it in GitHub Desktop.
Save spoletto/9383098 to your computer and use it in GitHub Desktop.
The undocumented behavior of ALAssetPropertyDate
/*
* In practice, what I've found is that ALAssetPropertyDate, which is documented as the "asset creation time"
* will return (always in UTC):
*
* (1) If taken from the native camera, a ms-precision time of when the photo was taken.
* (2) If EXIF exists, EXIF time converted to UTC based on the timezone the device was in when
* the photo was saved to the camera roll. This is sec-precision.
* (3) If EXIF does not exist, the time the photo was written into the camera roll. This is sec-precision.
*/
NSDate *timeTaken = [asset valueForProperty:ALAssetPropertyDate];
@igiu1988
Copy link

From this article, I found three types of date time in EXIF, so I am wondering which exif time convert to ALAssetPropertyDate? I can't make it out because I don't have a photo that has three different date time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment