-
Notifications
You must be signed in to change notification settings - Fork 104
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
Clarification ask: timewarp with --timezone 'named timezone' and --match-time: seems --match-time is ignored when using a 'named timezone' #1777
Comments
A possible workaround would be to use Result: In Photos is okay! timewarp -i still shows the shifted time with UTCOffset +01:00 as I think is not considering DST. In Photos in the Photo Info (enabling display of timezone on the Mac Regional Settings): 2017-06-24 21:26:51 CEST$ osxphotos timewarp -i
filename, uuid, photo time (local), photo time, timezone offset, timezone name, date added (local)
IMG_20170624_212651.JPG, 8984A3C1-EFD5-4AB2-9DB4-B39D32C48E3D, 2017-06-24 21:26:51+0100, 2017-06-24 21:26:51+0100, +0100, Europe/Lisbon, 2017-09-02 22:27:16+0100
$ osxphotos timewarp --timezone 'Europe/Madrid' --verbose --timestamp --time-delta '-01 hours' --force
2025-01-08 14:18:52.141249 -- Updated date/time for photo IMG_20170624_212651.JPG (8984A3C1-EFD5-4AB2-9DB4-B39D32C48E3D) from: 2017-06-24 21:26:51+01:00 to 2017-06-24 20:26:51+01:00
2025-01-08 14:18:52.202521 -- Updated timezone for photo IMG_20170624_212651.JPG (8984A3C1-EFD5-4AB2-9DB4-B39D32C48E3D) from Europe/Lisbon, offset=3600 to Europe/Madrid, offset=3600
2025-01-08 14:18:52.203266 -- Done.
$ osxphotos timewarp -i
filename, uuid, photo time (local), photo time, timezone offset, timezone name, date added (local)
IMG_20170624_212651.JPG, 8984A3C1-EFD5-4AB2-9DB4-B39D32C48E3D, 2017-06-24 20:26:51+0100, 2017-06-24 20:26:51+0100, +0100, Europe/Madrid, 2017-09-02 22:27:16+0100 |
I'll take a look. Likely a bug. I completely rewrote this part of the code a few months ago and it was extremely tricky to get right. My least favorite topic in programming is working with timezones! |
I get you! 😆 I guess not, but would time warp be able to operate over a specific photo (either with --uuid or --name or --album)? Or could I import timewarp from a python app and provide one by one the pics? Hmmm. I guess a combination of show and timewarp could do the trick! Hmmm. No. Show does not actually select the image. |
Yes, you can use |
::embarrassing:: 😃 not to have fully read the doc and looking for --uuid. The initial description for timewarp through me off: "Changes will be applied to all photos currently selected in Photos." What I see happening is that timewarp runs over the --uuid specified IDs plus the selected pics as it shows me the total pics tone $ osxphotos timewarp --uuid 70D3637B-1321-4AB5-93FC-6C4EB214BA23 --timezone 'Europe/Madrid' --time-delta '-3600 seconds'
⚠️ About to process 3 photos with timewarp. This will directly modify your
Photos library database using undocumented features. While this functionality
(...) But now that I know about it ... I jus make sure not to select any pic in Photos! ... and it will make my life SOOO MUCH EASIER to update thousands of wrong timezones pics! |
Yes, I should update the help text. Also, I think if I've been thinking about how to make
This would pipe a list of uuids to timewarp for processing. This avoids having to clutter timewarp with all the query options. It would require a new option for |
Yes, I'm currently going on an Herculean task to go thru my whole library to set Location and appropriate Timezone for all pics.
|
Did a few more tests and I thing issue is with DST. Lisbon TZ with DST offset is 3600 I guess on this line one should calculate the delta taking DST into consideration. Today I'm not feeling capable of working it out 😸 -- and there maybe side impacts I'm not aware! Do you agree this is the place? Some guidance from ou and maybe I can give it a try !! osxphotos/osxphotos/photodates.py Lines 209 to 215 in 56a6601
$ osxphotos timewarp --timezone 'Europe/Madrid' --verbose --timestamp --match-time --force
2025-01-08 13:16:15.728033 -- Skipping date/time update for photo IMG_20170624_212651.JPG (8984A3C1-EFD5-4AB2-9DB4-B39D32C48E3D), already matches new timezone Europe/Madrid
2025-01-08 13:16:15.783004 -- Updated timezone for photo IMG_20170624_212651.JPG (8984A3C1-EFD5-4AB2-9DB4-B39D32C48E3D) from Europe/Lisbon, offset=3600 to Europe/Madrid, offset=3600
2025-01-08 13:16:15.784026 -- Done. |
I think I see the problem. It's not actually in this part of the code. The old timezone offset is determined from the Photos database so that is considered "truth data". The new timezone offset is determined by the The Timezone for the new timezone is created here: osxphotos/osxphotos/photodates.py Lines 300 to 301 in 56a6601
The offset gets computed here (but doesn't account for DST, it returns just the offset for the standard timezone): osxphotos/osxphotos/photodates.py Lines 209 to 212 in 56a6601
What's needed is to add here an osxphotos/osxphotos/timezones.py Lines 38 to 68 in 56a6601
|
@oPromessa I'm going to need to fix this for another branch I'm working on to fix import time / timezone (#849 and #1661) so I'll update the fix for DST here as well. |
Before submitting a bug report, please ensure you are running the most recent version of osxphotos and that the bug is reproducible on the latest version
Describe the bug
Possibly not a bug, maybe an enhancement or I'misreading the timewarp scenarios with --timezone 'named timezone' vs UTCOffset and --match-time: for me it seems --match-time option is ignored when using a 'named timezone'.
From help timewarp --timezone we have this note also:
To Reproduce
1. Using 'named timezone' --match-time
Test 1 detail
In Photos in the Photo Info (enabling display of timezone on the Mac Regional Settings): 2017-06-24 22:26:51 CEST
2. Using 'UTC Offset' --match-time
Test 2 detail
In Photos in the Photo Info (enabling display of timezone on the Mac Regional Settings): 2017-06-24 21:26:51 GMT+2
3. Using 'named timezone'
Test 3 detail
In Photos in the Photo Info (enabling display of timezone on the Mac Regional Settings): 2017-06-24 22:26:51 CEST
Expected behavior
Would like to use --timezone 'named timezone' (respecting DST) and being able to use --match-time to keep the same timestamp.
Screenshots
N/A
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: