2
\$\begingroup\$

I'm working on an application which will extract some EXIF information from images including when the image was taken. I see that some images provide a DateTimeOriginal but not an OffsetTimeOriginal.

Can I safely assume these images are already in UTC? Or is it possible some old cameras might just let the user set the time but not the time zone. I.e. "12:34 PM" not "12:34 PM UTC+5".

I guess I could record whether or not I was able to extract a timezone and display some text next to the time the image was taken that indicates the timezone was unknown.

\$\endgroup\$

4 Answers 4

4
\$\begingroup\$

Other than the GPS timestamps, EXIF timestamps are supposed to be set to the local time where the image was taken. The three EXIF OffsetTime* are relatively new, having only been added in EXIF 2.31, 2016, while the EXIF standard itself dates back to 1998. And the OffsetTime* tags didn't receive widespread support until around 2019-2020.

Camera phones are the most likely to support the OffsetTime* tags, as they know what time zone they are in. DSLRs usually don't have GPS data without a an GPS accessory, so they will not automatically know the timezone. Most DSLR do have a setting for the timezone and this timezone is usually saved in the camera's MakerNotes.

One thing to note here is that in many cameras (I know Canon and Nikon do this) the Daylight savings is usually a separate ON/OFF setting. The MakerNotes time zone setting is not changed when it is Daylight savings and the time stamp is adjusted based upon the Daylight savings setting.

\$\endgroup\$
1
  • \$\begingroup\$ Ah thanks for the detailed explanation! That makes sense. \$\endgroup\$ Commented Nov 7, 2022 at 3:33
3
\$\begingroup\$

No.

First of all, you cannot reliably assume that any EXIF data at all is correct; all of it can be very trivially faked. Nor can you assume that the user even set the camera's time to anything close to the truth.

But if we rephrase the question as: provided that the user did set the camera's time to something they believed to be true, can you then assume that they intended it to be UTC?

Still no.

Most users, when given only the option to set a date and a time, but with no timezone indication, will set it to their local time, not UTC. I certainly always did exactly that because local time is what I use.

I tested it on my photo collection. I have used many different camera models over the years. It looks like the only camera I've ever used that sets this "OffsetTimeOriginal" field is my most recent Canon camera (Canon EOS M50). This makes sense because there is a way to configure the timezone in its menu, which I don't remember from other standalone cameras. All the others (other Canon cameras, various compact cameras, various smartphones) do not set this field.

I would assume, in most cases, that DateTimeOriginal without OffsetTimeOriginal is local time where the photo was taken.

\$\endgroup\$
3
  • \$\begingroup\$ I wouldn't assume local time is correct either. When I cross time zone borders with my camera, I don't bother to change its time setting. \$\endgroup\$ Commented Nov 7, 2022 at 16:28
  • \$\begingroup\$ @MarkRansom This is why I wrote "in most cases". Most people in the world do not live near a time zone boundary and do not very frequently cross time zone boundaries. Local time is the best guess possible. \$\endgroup\$
    – wonderbear
    Commented Nov 7, 2022 at 20:34
  • \$\begingroup\$ Oh I don't live near a time zone boundary either, and hardly ever go into another zone. But my comment still holds, I probably have a folder full of pictures from a European vacation that are 7 hours off. \$\endgroup\$ Commented Nov 7, 2022 at 21:33
1
\$\begingroup\$

You can assume the time is in UTC and the assumption is safe to the degree that being incorrect doesn’t have important consequences.

I mean it’s one thing if you are time ordering keyboard-cat memes. And another when the pictures are evidence in a capital murder trial.

But generally, my experience is that many cameras don’t require setting the time zone, and when I scan film it is days, weeks, or months later…and a few times nearly twenty years after the picture was made…fortunately, no missiles will be launched based on the EXIF data.

Anyway, best effort is the best you can do.

\$\endgroup\$
1
\$\begingroup\$

Likely not. If the camera doesn't record the time zone, it doesn't know about it, and has likely been set to local time by the user.

By the way, my camera (EOS 70D) doesn't encode an OffsetTimeOriginal but has TimeZone and Daylight savings. And the DateTimeOriginal contents are in local time, not UTC.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.