Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tiff-reviver to adjust from local time to UTC #99

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

websocket98765
Copy link

@websocket98765 websocket98765 commented Dec 3, 2022

Goal is to fix this issue where Tiff-based formats revive an inaccurate date.

@websocket98765
Copy link
Author

websocket98765 commented Dec 5, 2022

I realized '2009-09-23 11:40:52-06:00' is a standard format so I can simply using the date object to parse it into UTC, when in this format. Updated the code.

@grasdk
Copy link

grasdk commented Feb 10, 2024

@websocket98765 I know this is over 1 year old and there is not much active going on with exifr. However @MikeKovarik seems to be active on github still. If Mike ever gets around to this PR, I would like to comment with another idea:

I'm afraid that the problem lies with using the Date object in the first place. The Date object has bad support for timezones and alsways assumes the local timezone or UTC time. If you have two pictures, one in Sydney and one in London taken at the exact same time, their MS representation would be the same but the offset different. The Date object would simply show the two pictures taken at the exact same timestamp UTC or your local time. There is no option to show the time with their correct offsets.

Therefore, my opinion / idea as that all dates should simply be returned as they are read from the exif sections. In string format if need be, or as a millisecond value and an offset. Then it would be up to the user of exifr to determine how to use the values in their code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DateTime not accurate (offset by n hours)
2 participants