QuickTime:CreateDate and dates before 1974

Started by JlrJlr, October 30, 2023, 12:35:14 PM

Previous topic - Next topic

JlrJlr

Hello

I am scanning films of the 50's. I plan to store the date in QuickTime:CreateDate.


Setting QuickTime:CreateDate for date from 1974,  and over, is ok
exiftool -G1 -s -api QuickTimeUTC=1 -QuickTime:CreateDate="1974:01:01 01:02:03"   
    1 image files updated
exiftool -G1 -s -api QuickTimeUTC=1 -QuickTime:CreateDate 
[QuickTime]     CreateDate                      : 1974:01:01 01:02:03+01:00

Before 1974 result is unexpected
exiftool -G1 -s -api QuickTimeUTC=1 -QuickTime:CreateDate="1973:12:31 23:59:59" 
    1 image files updated
exiftool -G1 -s -api QuickTimeUTC=1 -QuickTime:CreateDate 
[QuickTime]     CreateDate                      : 2010:02:06 06:28:15+01:00

Note that if the difference to the expected date, that is 36 years 1 month 5 days, is substracted, the expected value appears
exiftool -G1 -s -api QuickTimeUTC=1 -QuickTime:CreateDate-="36:1:5 06:28:16"
    1 image files updated
exiftool -G1 -s -api QuickTimeUTC=1 -QuickTime:CreateDate
[QuickTime]     CreateDate                      : 1973:12:31 23:59:59+01:00


This correction value is also good for the 50's
exiftool -G1 -s -api QuickTimeUTC=1 -QuickTime:CreateDate="1950:12:31 23:59:59"   
    1 image files updated
exiftool -G1 -s -api QuickTimeUTC=1 -QuickTime:CreateDate
[QuickTime]     CreateDate                      : 1987:02:06 06:28:15+01:00

exiftool -G1 -s -api QuickTimeUTC=1 -QuickTime:CreateDate-="36:1:5 06:28:16" 
    1 image files updated
exiftool -G1 -s -api QuickTimeUTC=1 -QuickTime:CreateDate 
[QuickTime]     CreateDate                      : 1950:12:31 23:59:59+01:00


This is a workaround for my case. I am wondering if there is a better way to handle dates before 1974 ?

Thanks for any advice

Jean-Luc

wywh

#1
What OS and exiftool version are you using?

In my setup (macOS 13 -- I believe v14 is the same, exiftool 12.60) QuickTime:CreateDate (with '-api QuickTimeUTC=1') works down to 1970-0101-0000-00 (limit at UTC midnight) with .mp4, .m4v, .mov. That is the limit for Google Photos. In macOS Photos.app that seems to work even down to 1904, but I always revert using Keys for movies older than 1970:

Keys:CreationDate works down to year 0001 on macOS Photos.app. On Google Photos it works down to 1902 -- for earlier dates it might randomly display a wrong date and even if it displays the correct date, it might sort that movie incorrectly.

UserData:DateTimeOriginal works the same as Keys but currently Keys is better supported for movies in macOS.

For example:

exiftool -overwrite_original -api QuickTimeUTC=1 -QuickTime:CreateDate='1970:01:01 01:01:01' movie.mp4
    1 image files updated
exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All movie.mp4                   
[QuickTime]     CreateDate                      : 1970:01:01 01:01:01+02:00

exiftool -overwrite_original -api QuickTimeUTC=1 -QuickTime:CreateDate='1904:01:01 01:39:49' movie.mp4
    1 image files updated
exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All movie.mp4                   
[QuickTime]     CreateDate                      : 1904:01:01 01:39:49+01:39

exiftool -overwrite_original -api QuickTimeUTC=1 -QuickTime:CreateDate='1904:01:01 01:39:48' movie.mp4
    1 image files updated
exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All movie.mp4                   
[QuickTime]     CreateDate                      : 2040:02:06 08:28:15+02:00

exiftool -overwrite_original -api QuickTimeUTC=1 -Keys:CreationDate='0001:01:01 00:00:00' movie.mp4
    1 image files updated
exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All movie.mp4                 
[Keys]          CreationDate                    : 0001:01:01 00:00:00+02:00

p.s. the weird time "01:39:49+01:39" that happens before 1 May 1921 seems to relate to the adjustment 30 April 1921 at midnight when our official time was advanced 20 minutes and 10.9 seconds.

- Matti

JlrJlr

I forgot to write that I am using Exiftool 12.67 on Windows 10 and .mp4 files
I check that the correction is ok up to year 1904

Thank Matti for your very fast answer it looks promissing.

I tried the 2 tags but no success, what did I miss ?

exiftool -ver -G1 -s -api QuickTimeUTC=1 -Keys:CreationDate="1950:12:31 23:59:59" -UserData:DateTimeOriginal="1950:12:31 23:59:59"  -ext mp4 
12.67
Warning: Error converting value for Keys:CreationDate (ValueConvInv)
Warning: Error converting value for UserData:DateTimeOriginal (ValueConvInv)
Nothing to do.

Thanks for more advice
Jean-Luc

StarGeek

I'm guessing that this is related in some way to the yearly creep that can be found with the file system timestamps, at least on Windows.  One of my previous posts on the subject. The date with that has now crept up to 1973:12:31 23:59:59

Writing the date/time without the -api QuickTimeUTC option seems to work fine.

Writing QuickTime:CreateDate without the -api QuickTimeUTC
C:\>exiftool -P -overwrite_original -Quicktime:CreateDate="1973:12:31 23:59:59" Y:\!temp\x\y\Test.mp4
    1 image files updated

C:\>exiftool -G -a -s -CreateDate Y:\!temp\x\y\Test.mp4
[QuickTime]     CreateDate                      : 1973:12:31 23:59:59

C:\>exiftool -G -a -s -api QuickTimeUTC -CreateDate Y:\!temp\x\y\Test.mp4
[QuickTime]     CreateDate                      : 1973:12:31 15:59:59-08:00

Writing with -api QuickTimeUTC
C:\>exiftool -P -overwrite_original -api QuickTimeUTC -Quicktime:CreateDate="1973:12:31 23:59:59" Y:\!temp\x\y\Test.mp4
    1 image files updated

C:\>exiftool -G -a -s -CreateDate Y:\!temp\x\y\Test.mp4
[QuickTime]     CreateDate                      : 2010:02:06 14:28:15

C:\>exiftool -G -a -s -api QuickTimeUTC -CreateDate Y:\!temp\x\y\Test.mp4
[QuickTime]     CreateDate                      : 2010:02:06 06:28:15-08:00

Writing FileModifyDate (-api QuickTimeUTC will not affect this tag)
C:\>exiftool -P -overwrite_original -FileModifyDate="1974:01:01 00:00:00" Y:\!temp\x\y\Test.mp4
    1 image files updated

C:\>exiftool -G -a -s -FileModifyDate Y:\!temp\x\y\Test.mp4
[File]          FileModifyDate                  : 1974:01:01 00:00:00-08:00

C:\>exiftool -P -overwrite_original -FileModifyDate="1973:12:31 23:59:59" Y:\!temp\x\y\Test.mp4
    1 image files updated

C:\>exiftool -G -a -s -FileModifyDate Y:\!temp\x\y\Test.mp4
[File]          FileModifyDate                  : 1873:12:30 23:59:59-08:00

Both tags, with -api QuickTimeUTC, going back a few years
C:\>exiftool -P -overwrite_original -FileModifyDate="1972:12:31 23:59:59" -Quicktime:CreateDate="1972:12:31 23:59:59" Y:\!temp\x\y\Test.mp4
    1 image files updated

C:\>exiftool -G -a -s -FileModifyDate -CreateDate Y:\!temp\x\y\Test.mp4
[File]          FileModifyDate                  : 1872:12:30 23:59:59-08:00
[QuickTime]     CreateDate                      : 1972:12:31 23:59:59

C:\>exiftool -P -overwrite_original -api QuickTimeUTC -FileModifyDate="1972:12:31 23:59:59" -Quicktime:CreateDate="1972:12:31 23:59:59" Y:\!temp\x\y\Test.mp4
    1 image files updated

C:\>exiftool -G -a -s -FileModifyDate -CreateDate Y:\!temp\x\y\Test.mp4
[File]          FileModifyDate                  : 1872:12:30 23:59:59-08:00
[QuickTime]     CreateDate                      : 2009:02:06 14:28:15

C:\>exiftool -P -overwrite_original -api QuickTimeUTC -FileModifyDate="1971:12:31 23:59:59" -Quicktime:CreateDate="1971:12:31 23:59:59" Y:\!temp\x\y\Test.mp4
    1 image files updated

C:\>exiftool -G -a -s -FileModifyDate -CreateDate Y:\!temp\x\y\Test.mp4
[File]          FileModifyDate                  : 1871:12:30 23:59:59-08:00
[QuickTime]     CreateDate                      : 2008:02:06 14:28:15

C:\>exiftool -P -overwrite_original -api QuickTimeUTC -FileModifyDate="1970:12:31 23:59:59" -Quicktime:CreateDate="1970:12:31 23:59:59" Y:\!temp\x\y\Test.mp4
    1 image files updated

C:\>exiftool -G -a -s -FileModifyDate -CreateDate Y:\!temp\x\y\Test.mp4
[File]          FileModifyDate                  : 1870:12:30 23:59:59-08:00
[QuickTime]     CreateDate                      : 2007:02:06 14:28:15
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

StarGeek

Quote from: JlrJlr on October 30, 2023, 02:40:30 PMI tried the 2 tags but no success, what did I miss ?

Exiftool needs a timezone for those two tags, at least on dates before 1974:01:01 00:00:00. The -api QuickTimeUTC does nothing for these two tags, as they are of a different type than the other Quicktime timestamps.

You can force a write without the time zone by adding a hashtag to the end of the tag name
C:\>exiftool -P -overwrite_original -Quicktime:CreationDate#="1950:12:31 23:59:59" -UserData:DateTimeOriginal#="1950:12:31 23:59:59" Y:\!temp\x\y\Test.mp4
    1 image files updated

C:\>exiftool -G1 -a -s -CreationDate -DateTimeOriginal Y:\!temp\x\y\Test.mp4
[Keys]          CreationDate                    : 1950:12:31 23:59:59
[UserData]      DateTimeOriginal                : 1950:12:31 23:59:59
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

StarGeek

Edit: Looking closer @wywh output leads me to think this is a Windows problem.  I can't remember if the file system problem was narrowed down to only Windows or not.

List of previous times this has come up with regards to the file system timestamps.  I think this is the first time with regards to the Quicktime timestamps.

Nov 2017
Jan 2018
May 2018
Aug 2018
March 2019
November 2022
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

wywh

Quote from: StarGeek on October 30, 2023, 03:04:56 PMExiftool needs a timezone for those two tags, at least on dates before 1974:01:01 00:00:00

At least in macOS Keys and UserData dates work without added timezones:

"Dec. 24, 2020 - Version 12.13
Add time zone automatically to most string-based QuickTime date/time tags when writing unless the PrintConv option is disabled".

With -n exiftool leaves timezone OFF (current Photos.app no longer scrambles timezone-less movie dates):

exiftool -overwrite_original -Keys:CreationDate='1950:12:31 23:59:59' -UserData:DateTimeOriginal='1950:12:31 23:59:59' movie.mp4
    1 image files updated
exiftool -a -G1 -s -Time:All movie.mp4
[UserData]      DateTimeOriginal                : 1950:12:31 23:59:59+02:00
[Keys]          CreationDate                    : 1950:12:31 23:59:59+02:00

exiftool -n -overwrite_original -Keys:CreationDate='1950:12:31 23:59:59' -UserData:DateTimeOriginal='1950:12:31 23:59:59' movie.mp4
    1 image files updated
exiftool -a -G1 -s -Time:All movie.mp4                                                                                            
[UserData]      DateTimeOriginal                : 1950:12:31 23:59:59
[Keys]          CreationDate                    : 1950:12:31 23:59:59

- Matti

StarGeek

So that means that not writing those Quicktime tags is a Windows problem.
C:\>exiftool -P -overwrite_original -Keys:CreationDate="1950:12:31 23:59:59" -UserData:DateTimeOriginal="1950:12:31 23:59:59" Y:\!temp\x\y\Test.mp4
Warning: Error converting value for Keys:CreationDate (ValueConvInv)
Warning: Error converting value for UserData:DateTimeOriginal (ValueConvInv)
Nothing to do.

C:\>exiftool -P -overwrite_original -Keys:CreationDate="1973:12:31 23:59:59" -UserData:DateTimeOriginal="1973:12:31 23:59:59" Y:\!temp\x\y\Test.mp4
Warning: Error converting value for Keys:CreationDate (ValueConvInv)
Warning: Error converting value for UserData:DateTimeOriginal (ValueConvInv)
Nothing to do.

C:\>exiftool -P -overwrite_original -Keys:CreationDate="1974:01:01 00:00:00"" -UserData:DateTimeOriginal="1974:01:01 00:00:00" Y:\!temp\x\y\Test.mp4
    1 image files updated
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

JlrJlr

#8
A big thank you all for your analysis and advice's. Exiftool forum community is very helping.

As a summary
Keys:CreationDate UserData:DateTimeOriginal needs time zone but api is indifferent

QuickTime:CreateDate needs time zone and api is mandatory in both write and read
notice that read without API is funny

\exiftool -ver -G1 -s -api QuickTimeUTC=1 -QuickTime:CreateDate="1952:12:31 23:59:59+01:00"  -Keys:CreationDate="1952:12:31 23:59:59+01:00" -UserData:DateTimeOriginal="1952:12:31 23:59:59+01:00"  -ext mp4 
12.67
    1 image files updated

\exiftool -G1 -s  -QuickTime:CreateDate -Keys:CreationDate -UserData:DateTimeOriginal  -ext mp4 
[QuickTime]     CreateDate                      : 2019:01:01 22:59:59
[Keys]          CreationDate                    : 1952:12:31 23:59:59+01:00
[UserData]      DateTimeOriginal                : 1952:12:31 23:59:59+01:00

\exiftool -G1 -s -api QuickTimeUTC=1 -QuickTime:CreateDate -Keys:CreationDate -UserData:DateTimeOriginal  -ext mp4
[QuickTime]     CreateDate                      : 1952:12:31 23:59:59+01:00
[Keys]          CreationDate                    : 1952:12:31 23:59:59+01:00
[UserData]      DateTimeOriginal                : 1952:12:31 23:59:59+01:00

case of no api in write; QuickTime:CreateDate is not updated
exiftool -ver -G1 -s -QuickTime:CreateDate="1951:12:31 23:59:59+01:00"  -Keys:CreationDate="1951:12:31 23:59:59+01:00" -UserData:DateTimeOriginal="1951:12:31 23:59:59+01:00"  -ext mp4
12.67
    1 image files updated

exiftool -G1 -s  -QuickTime:CreateDate -Keys:CreationDate -UserData:DateTimeOriginal  -ext mp4
[QuickTime]     CreateDate                      : 2017:12:31 23:59:59
[Keys]          CreationDate                    : 1951:12:31 23:59:59+01:00
[UserData]      DateTimeOriginal                : 1951:12:31 23:59:59+01:00

exiftool -G1 -s -api QuickTimeUTC=1 -QuickTime:CreateDate -Keys:CreationDate -UserData:DateTimeOriginal  -ext mp4
[QuickTime]     CreateDate                      : 1952:01:01 00:59:59+01:00
[Keys]          CreationDate                    : 1951:12:31 23:59:59+01:00
[UserData]      DateTimeOriginal                : 1951:12:31 23:59:59+01:00

StarGeek

Quote from: JlrJlr on October 30, 2023, 06:16:34 PMAs a summary
Keys:CreationDate UserData:DateTimeOriginal needs time zone but api is indifferent

Only on Windows when the date is before 1974:01:01.  Or you can write it directly by adding a hashtag to the end of the tag name, e.g. -Keys:CreationDate#="1952:12:31 23:59:59"

QuoteQuickTime:CreateDate needs time zone and api is mandatory in both write and read
notice that read without API is funny

Not quite.  This applies to Windows, not Linux/Mac.

If it is on or after 1974:01:01, you can write it with -api QuickTimeUTC and exiftool will adjust the time from local to UTC.

If it is before 1974:01:01, you can't use -api QuickTimeUTC as that will write bad dates. 

You can write it directly in either case without -api QuickTimeUTC and exiftool will write the exact unadjusted value.  You will have to manually adjust it to UTC.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype