PHAsset
has a creationDate
property that gives the creation date of the asset in UTC.
If I take a photo taken at 10:52 PM UTC-6, the creationDate
property is 03:52 AM.
How am I supposed to know the 'true' time of the photo taken? No timezone information is supplied with the creationDate
property, so I can't adjust this back to 10:52 PM - I have no idea what time zone to just when adjusting it...
I know I can get the EXIF creation date (or attempt to at least) using PHImageManager requestImageDataForAsset
and using the data returned there to obtain an EXIF creation date which actually is 10:52 PM, but this results in very slow for performance when the photos are in iCloud (I need this creation date value for all assets in the user's library). Additionally I cannot figure out how to get the EXIF creation date for videos.
I also know there are methods of obtaining a timezone from a CLLocation
, which I could use to adjust the creationDate
- but these methods are either rate limited and/or inaccurate
Is there another, easier way, to get this original creation date value?
To recap:
- A photo is taken at 10:52 PM in UTC-6
- PHAsset creation date is 03:52 AM in UTC
- I want to know how to get 10:52 PM UTC-6 date/time.