-
Notifications
You must be signed in to change notification settings - Fork 99
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
utc to local timezone handling wrong #1356
Comments
These two times are the same. When it is 2020-09-03 20:45:18+01:00 WEST The time in UTC would be 2020-09-03 19:45:18+00:00 UTC As UTC is one hour earlier. What am I missing? |
The input to |
Google converts local timezone to UTC in the Takeout sidecar. This local timezone of where the photo was taken is lost. If imported into Photos without conversion Photos will assume the timezone is local timezone. But the time in UTC is not correct for local timezone (unless local is UTC), thus the conversion. I've tested this on a test case for which I know the correct local time and it appears to be working. Entirely possible I've messed up something but I don't understand the situation at the moment. The desired outcome is that the UTC time is translated to the equivalent time in the local timezone. I'm traveling and don't have my Mac with me so can't test at the moment. |
Ok, I think I see the issue. The initial conversion from timestamp converts a naive time into naive timestamp in local timezone. This may be occurring elsewhere (Eg parse date) so need to ensure that code path is also correct. |
Describe the bug
When importing from Google Takeout while using the sidecar information, the local timezone is applied cumulatively twice, resulting in wrong timestamps being set in Photos.
To Reproduce
Steps to reproduce the behavior:
osxphotos import ./Takeout/p1 --relative-to . --walk --album "{filepath.parent}" --skip-dups --dup-albums --sidecar --verbose --keyword "{person}" --report takeout_import.csv --resume --append --split-folder "/"
No errors on the command line.
Expected behavior
UTC to local timezone transformation applied once on the sidecar timestamp.
Print-outs
Reading :
osxphotos/osxphotos/metadata_reader.py
Lines 247 to 259 in f1b2481
This is what happens now:
This is what should be happening:
Desktop (please complete the following information):
Additional context
I might be missing some other case where setting it to UTC would fail but I'll link a pull request for now.
The text was updated successfully, but these errors were encountered: