andrewning / sortphotos

SortPhotos is a Python script that organizes photos and videos into folders using date/time information

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to sort by local time zone and not UTC?

volcs0 opened this issue · comments

Photos are getting sorted by the UTC-stamped date and not the local time. Here is an example. I'd like this video to be in 2021/December/16, but it is getting sorted into 2021/December/17, since the stamped date is 12/17 (6 hours ahead of me).
I do not see where I can modify this behavior, if possible. Thanks.

Edit: I am not sure if it matters, but I set the EXIFTOOL config to always use QuickTimeUTC, so now the time zone offset is pulled along with the time. But sortphotos is not using this to set the date.

In this example, the capture date is 12/16/2021 at 8:48pm, but it is getting sorted to 12/17/2021, since that was the UTC time.

bash-5.1$ sortphotos /Volumes/Clyde/test2 /Volumes/Clyde/testorganize --test --use-only-tags QuickTime:CreateDate --sort %Y/%m\ -\ %B/%d
Preprocessing with ExifTool.  May take a while for a large number of files.
    1 directories scanned
    1 image files read
[{
  "SourceFile": "/Volumes/Clyde/test2/20211216_204810.mp4",
  "QuickTime:CreateDate": "2021:12:16 20:48:48-06:00"
}]
{ready}

[1/1] (TEST - no files are being moved/copied)
Source: /Volumes/Clyde/test2/20211216_204810.mp4
Date/Time: 2021-12-17 02:48:48
Corresponding Tags: QuickTime:CreateDate
Destination (move): /Volumes/Clyde/testorganize/2021/12 - December/17/20211216_204810.mp4

I believe I'm seeing the same thing. .mov file taken with an iPhone. QuickTime:CreationDate shows the correct date/time of 2017:06:01 18:52:56. However, it is moved into the following day due to UTC.

Is there a way to pass the exiftool -api QuickTimeUTC parameter?

sortphotos -t --sort "E:\Photos\%Y\%Y_%m_%d" E:\Photos\test E:\Photos
Preprocessing with ExifTool.  May take a while for a large number of files.
    1 directories scanned
    1 image files read
[{
  "SourceFile": "E:/Photos/test/IMG_7346.MOV",
  "File:FileModifyDate": "2017:07:09 19:40:09-06:00",
  "File:FileAccessDate": "2022:04:03 22:49:42-06:00",
  "File:FileCreateDate": "2022:04:03 22:49:42-06:00",
  "QuickTime:CreateDate": "2017:06:02 00:52:56",
  "QuickTime:ModifyDate": "2017:06:02 00:53:27",
  "QuickTime:TrackCreateDate": "2017:06:02 00:52:56",
  "QuickTime:TrackModifyDate": "2017:06:02 00:53:27",
  "QuickTime:MediaCreateDate": "2017:06:02 00:52:56",
  "QuickTime:MediaModifyDate": "2017:06:02 00:53:27",
  "QuickTime:CreationDate": "2017:06:01 18:52:56-06:00"
}]
{ready}

[1/1] (TEST - no files are being moved/copied)
Source: E:/Photos/test/IMG_7346.MOV
Date/Time: 2017-06-02 00:52:56
Corresponding Tags: QuickTime:CreateDate, QuickTime:TrackCreateDate, QuickTime:MediaCreateDate, QuickTime:CreationDate
Destination (move): E:\Photos\2017\2017_06_02\IMG_7346.MOV