Is there a way to get the ExifTool ModifyDate and CreateDate to consistently match what the MacOS Finder reports for them?
I've noticed that both of these dates for images (TIFF, PSD, PSB, etc.) don't always return the same date/time as what the MacOS Finder uses to display them. I thought this may be related to time zone differences between where the modification/creation was done vs the time zone of the system that is requesting them, but in the example attached, the dates are much further apart. Maybe older metadata formats? (Dates appear to match on images I create/modify locally.)
I thought I was following what I found in other posts to ensure they returned the equivalents in the local time zone, but perhaps I'm doing something wrong?
*Note: I have CommandLineTools for Xcode (version 14.2.0.0.1.1668646533) installed:
> xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
> xcode-select -p
/Library/Developer/CommandLineTools
> xcodebuild -version
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
> pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version
version: 14.2.0.0.1.1668646533
* I've confirmed the Modification Date returned from STAT matches the date/time in the Finder/Get Info:
> stat -f "%Sm" -t "%Y:%m:%d %H:%M:%S" FILE
2012:07:10 19:13:52
* However, ExifTool returns a different ModifyDate using the code below:
> exiftool -time:modifydate -G1 -a -s -api requestall=3 FILE
[IFD0] ModifyDate : 2009:04:09 14:33:03
[XMP-xmp] ModifyDate : 2009:04:09 14:33:03+02:00
Am I doing something wrong? In the meantime, I've been using STAT to get my dates.
System Specs:
» macOS Monterey 12.6.3
» Xcode 14.2.0.0.1.1668646533 (CommandLineTools)
» ExifTool 12.54
» Local Time Zone: PST (UTC/GMT -8 hours)
Reference image attached:
TimeZoneTest.tif
Try something like this (the file dates are quite fragile as you can see after downloading this sample file):
exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All -api RequestAll=2 .
======== ./TimeZoneTest.tif
[System] FileModifyDate : 2023:02:12 14:05:21+02:00
[MacOS] FileCreateDate : 2023:02:12 14:05:21+02:00
[IFD0] ModifyDate : 2009:04:09 14:33:03
exiftool -m -P -overwrite_original_in_place '-FileCreateDate<IFD0:ModifyDate' '-FileModifyDate<IFD0:ModifyDate' .
Warning: IPTCDigest is not current. XMP may be out of sync - ./TimeZoneTest.tif
1 directories scanned
1 image files updated
exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All -api RequestAll=2 .
======== ./TimeZoneTest.tif
[System] FileModifyDate : 2009:04:09 14:33:03+03:00
[MacOS] FileCreateDate : 2009:04:09 14:33:03+03:00
[IFD0] ModifyDate : 2009:04:09 14:33:03
...but I prefer to use ExifIFD:DateTimeOriginal as a golden standard for image files instead that IFD0:ModifyDate.
- Matti
Thank you for the tip on the -api QuickTimeUTC=1; I thought that was related to QuickTime movies!🤦
You're right, all of these dates are fragile, and too many of them. I had opened Bridge and saw it was reporting differently there too, but now OS, Bridge and ExifTool are all reporting the same Modification Date.
Will have to dive into this deeper later and do something similar with the Creation Date as I'm seeing discrepancies there as well after running the code you provided on the -overwrite_original_in_place file per your suggestion (resulted in 14:33 MacOS vs 13:30 CreateDate). Bridge reports 13:20 as the Date Created and 14:33 as the Date File Created.
> exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All -api RequestAll=2 FILE
[ExifTool] Now : 2023:02:12 10:48:11-08:00
[System] FileModifyDate : 2009:04:09 14:33:03-07:00
[System] FileAccessDate : 2023:02:12 10:01:06-08:00
[System] FileInodeChangeDate : 2023:02:12 10:01:04-08:00
[MacOS] FileCreateDate : 2009:04:09 14:33:03-07:00
[MacOS] MDItemContentCreationDate : 2009:04:09 14:33:03-07:00
[MacOS] MDItemContentCreationDate_Ranking: 2009:04:08 17:00:00-07:00
[MacOS] MDItemContentModificationDate : 2009:04:09 13:20:58-07:00
[MacOS] MDItemContentModificationDate_Ranking: 2009:04:08 17:00:00-07:00
[MacOS] MDItemDateAdded : 2023:02:12 09:58:52-08:00
[MacOS] MDItemDateAdded_Ranking : 2023:02:11 16:00:00-08:00
[MacOS] MDItemFSContentChangeDate : 2009:04:09 14:33:03-07:00
[MacOS] MDItemFSCreationDate : 2009:04:09 14:33:03-07:00
[MacOS] MDItemInterestingDate_Ranking : 2023:02:11 16:00:00-08:00
[MacOS] MDItemLastUsedDate : 2023:02:12 09:56:22-08:00
[MacOS] MDItemUsedDates : 2023:02:12 00:00:00-08:00
[MacOS] XAttrLastUsedDate : 2023:02:12 17:56:22
[IFD0] ModifyDate : 2009:04:09 14:33:03
[XMP-xmp] CreateDate : 2009:04:09 13:20:58+02:00
[XMP-xmp] ModifyDate : 2009:04:09 14:33:03+02:00
[XMP-xmp] MetadataDate : 2009:04:09 14:33:03+02:00
[XMP-xmpMM] HistoryWhen : 2008:11:19 15:16:48+01:00, 2008:11:20 16:29+01:00, 2008:11:21 11:06:53+01:00
Zipped file attached of the before and after files (to hopefully maintain the metadata this time) for reference.
TimeZoneTests.zip
Quote from: Chris S on February 12, 2023, 02:03:56 PMThank you for the tip on the -api QuickTimeUTC=1; I thought that was related to QuickTime movies!
Quicktime (https://exiftool.org/TagNames/QuickTime.html) is the standard for Mov/Mp4 videos and related file types, such as m4a.
Quote from: Chris S on February 12, 2023, 02:03:56 PM-api QuickTimeUTC=1; I thought that was related to QuickTime movies
You are correct -- it is for QuickTime movies (.mp4, .m4v, .mov). But as a habit I use it also when checking image dates because it has no effect if used for images. Sometimes I forget to use it and then wonder why movie dates seem to be off because they are displayed as UTC.
In macOS '-FileCreateDate<IFD0:ModifyDate' '-FileModifyDate<IFD0:ModifyDate' commands ask for Xcode Command Line Tools install which can be ignored but then the FileCreateDate moves only backwards in time (the install is quite small and fast, not the huge Xcode install).
- Matti
Thank you for clarifying. It appears you should use -FileCreateDate or -FileModifyDate instead of -ModifyDate or -CreateDate when you want to return the dates/times displayed by the MacOS Finder/Get Info if you don't want to use -overwrite_original_in_place. (Probably a helpful documentation tip for MacOS users.)
MacOS Finder/Get Info Reports:
Date Created: 04/09/09 14:33 [2009:04:09 14:33]
Date Modified: 07/10/12 19:13 [2009:07:10 19:33]
same via STAT:
> stat -f "%SB %Sm " -t "%m/%d/%y %H:%M:%S" FILE
04/09/09 14:33:03 07/10/12 19:13:52
ExifTool MATCHES MacOS:
> exiftool -s -FileCreateDate -FileModifyDate FILE
FileCreateDate : 2009:04:09 14:33:03-07:00
FileModifyDate : 2012:07:10 19:13:52-07:00
ExifTool may NOT (always) match MacOS:
> exiftool -s -CreateDate -ModifyDate FILE
CreateDate : 2009:04:09 13:20:58+02:00
ModifyDate : 2009:04:09 14:33:03
Quote from: Chris S on February 13, 2023, 01:36:58 PMExifTool may NOT (always) match MacOS:
But those are different tags that macOS Finder does not report. Tag names such as ModifyDate can appear in many places and the apps might favor one over the other, or sometimes pick a random tag to use...:
IFD0:ModifyDate
XMP-xmp:ModifyDate
To check the dates, I always use exiftool command that shows only the date tags (-Time:All), actual tag names (-s), what groups they belong to (-G1 or sometimes in messy movie metadata -G1:7), duplicate tags (-a) and especially movie 'QuickTime' tags with system timezone instead UTC (-api QuickTimeUTC=1):
exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All movie.mp4
Show also MacOS FileCreateDate that some apps might prefer:
exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All -api RequestAll=2 movie.mp4
p.s. I wonder why this is not the default because many people seem to stumble on this:
exiftool -a -G1 -s .
- Matti
Quote from: Chris S on February 13, 2023, 01:36:58 PM(Probably a helpful documentation tip for MacOS users.)
Except this is a very specific, Mac only command. It is nearly impossible to cover every possible variation on what every OS and program displays as the name for one, possible multiple, tags. I know because I've tried (https://exiftool.org/forum/index.php?topic=6591.msg32875#msg32875). It took a lot of time just to work out that data, which may change at the whim of Microsoft.
This is the reason FAQ #3 (https://exiftool.org/faq.html#Q3) exists and should
always be your default command when looking at a file.
Quote from: wywh on February 13, 2023, 02:08:13 PMBut those are different tags that macOS Finder does not report. Tag names such as ModifyDate can appear in many places and the apps might favor one over the other, or sometimes pick a random tag to use...:
Matti, perhaps I jumped to conclusions since the
-FileModifyDate and
-FileCreateDate tags matched what was reported by the MacOS Finder (for the problematic test image I provided anyway... I don't have a use case for QuickTime):
> exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All -api RequestAll=2 FILE
...
[System] FileModifyDate : 2012:07:10 19:13:52-07:00
...
[MacOS] FileCreateDate : 2009:04:09 14:33:03-07:00
...
[IFD0] ModifyDate : 2009:04:09 14:33:03
[XMP-xmp] CreateDate : 2009:04:09 13:20:58+02:00
[XMP-xmp] ModifyDate : 2009:04:09 14:33:03+02:00
...
If these aren't the metadata fields MacOS Finder uses, which are?
MacOS:MDItemContentCreationDate,
MacOS:MDItemContentCreationDate and
MacOS:MDItemFSContentChangeDate are the only other 3 that match.
Below is the code and entire list that was returned for reference, again noting what is displayed by the Finder window or "Get Info":
Created: 04/09/09 14:33 [2009:04:09 14:33]
» Match: [MacOS] FileCreateDate
» Match: [MacOS] MDItemContentCreationDate
» Match: [MacOS] MDItemFSCreationDate
Modified: 07/10/12 19:13 [2009:07:10 19:33]
» Match: [System] FileModifyDate
» Match: [MacOS] MDItemFSContentChangeDate
> exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All -api RequestAll=2 FILE
[ExifTool] Now : 2023:02:12 10:48:11-08:00
[System] FileModifyDate : 2009:04:09 14:33:03-07:00
[System] FileAccessDate : 2023:02:12 10:01:06-08:00
[System] FileInodeChangeDate : 2023:02:12 10:01:04-08:00
[MacOS] FileCreateDate : 2009:04:09 14:33:03-07:00
[MacOS] MDItemContentCreationDate : 2009:04:09 14:33:03-07:00
[MacOS] MDItemContentCreationDate_Ranking: 2009:04:08 17:00:00-07:00
[MacOS] MDItemContentModificationDate : 2009:04:09 13:20:58-07:00
[MacOS] MDItemContentModificationDate_Ranking: 2009:04:08 17:00:00-07:00
[MacOS] MDItemDateAdded : 2023:02:12 09:58:52-08:00
[MacOS] MDItemDateAdded_Ranking : 2023:02:11 16:00:00-08:00
[MacOS] MDItemFSContentChangeDate : 2009:04:09 14:33:03-07:00
[MacOS] MDItemFSCreationDate : 2009:04:09 14:33:03-07:00
[MacOS] MDItemInterestingDate_Ranking : 2023:02:11 16:00:00-08:00
[MacOS] MDItemLastUsedDate : 2023:02:12 09:56:22-08:00
[MacOS] MDItemUsedDates : 2023:02:12 00:00:00-08:00
[MacOS] XAttrLastUsedDate : 2023:02:12 17:56:22
[IFD0] ModifyDate : 2009:04:09 14:33:03
[XMP-xmp] CreateDate : 2009:04:09 13:20:58+02:00
[XMP-xmp] ModifyDate : 2009:04:09 14:33:03+02:00
[XMP-xmp] MetadataDate : 2009:04:09 14:33:03+02:00
[XMP-xmpMM] HistoryWhen : 2008:11:19 15:16:48+01:00, 2008:11:20 16:29+01:00, 2008:11:21 11:06:53+01:00
Thanks!
I have always looked at just MacOS:FileCreateDate and System:FileModifyDate which are the same as in Finder > Get Info dialog (notice sometimes Finder might be lazy to update its info).
I have not paid much attention to those MacOS:MDItem* or MacOS:XAttrLastUsedDate tags, some of which usually have the same dates as above.
Notice that in order some metadata to display in the Finder > Get Info, the file must be on a Spotlight-indexed APFS or MacOS Extended volume.
- Matti
Ah, my bad... looking back I was confused when you said "But those are different tags that macOS Finder does not report." I see I didn't notice you had quoted a statement that was in reference to the CreatedDate and ModifiedDate, rather than the FileCreateDate and FileModifyDate that I had posted as my learnings. All good! The can wrap this one up. :)