Time zone for PHAsset creationDate

Dear Experts,

PHAsset.creationDate is an NSDate, which does not have a timezone associated with it, right?

Consider a photo viewer app. If I take a photo of the sunrise at 0600 local time while I am away, when I get home and view the photo in the app, I believe I want the timestamp shown with the photo to be 0600. Do you agree?

But NSDate is just a time-point, and I don't think Foundation (or anything else in iOS) has a type that combines a time-point with a time zone. Nor does PHAsset have any other useful attributes - unless I were to determine the time zone from the location!

Am I missing anything?

NSDate is timezone-agnostic; it stores its dates relative to a fixed point. But NSDateFormatter is what you use to turn that into a date string, and that class has an NSTimeZone property.

AAaaarrgghh I wrote a long reply but this ******* useless ****** forum said "Unauthorized" when I pressed Submit and then Back shows an empty box. **** **** ****.

Summary:

Many cameras don't even have a time zone setting, and the ones that do, the user probably is not remembering to set it.

The iPhone does know the time zone.

Looking at the EXIF metadata for a photo from an iPhone, it does include the timezone.

But getting arbitrary EXIF fields using PHAsset is awkward. You have to fetch the entire image data, which is not great if they are e.g. iCLoud images and you just want to show thumbnails on a timeline.

You’re exactly right. We need the associated time zone in order to display the correct date/time to the user. I submitted FB13363638: PHAsset and PHContentEditingInput API to get creation date time zone.

Note the time zone can be changed independently of the location via Adjust Date & Time, and photos don’t always have location anyways, so it’s not reliable to infer a time zone from its location.

Time zone for PHAsset creationDate
 
 
Q