How copy "Creation Date " to all (Create Date, Modify Date and so on)

Started by olegdnepr81, February 06, 2023, 10:21:56 AM

Previous topic - Next topic

olegdnepr81

I have *.mov files from Iphone, their Create Date, Modify Date are not correct but when I used exiftool I found  field "Creation Date" with correct data.

How copy "Creation Date" info to "Create Date, Modify Date" and make changes for all folder with files by terminal .

ExifTool Version Number         : 12.55
File Name                       : IMG_4707.MOV
Directory                       : /Users/olegpysarenko/Desktop/test
File Size                       : 3.1 MB
File Modification Date/Time     : 2018:10:01 17:27:00+03:00
File Access Date/Time           : 2018:10:01 17:27:00+03:00
File Inode Change Date/Time     : 2023:02:06 16:51:12+02:00
File Permissions                : -rwxrwxrwx
File Type                       : MOV
File Type Extension             : mov
MIME Type                       : video/quicktime
Major Brand                     : Apple QuickTime (.MOV/QT)
Minor Version                   : 0.0.0
Compatible Brands               : qt
Media Data Size                 : 3037220
Media Data Offset               : 36
Movie Header Version            : 0
Create Date                     : 2019:07:01 01:23:54
Modify Date                     : 2019:07:01 01:23:55
Time Scale                      : 600
Duration                        : 1.87 s
Preferred Rate                  : 1
Preferred Volume                : 100.00%
Preview Time                    : 0 s
Preview Duration                : 0 s
Poster Time                     : 0 s
Selection Time                  : 0 s
Selection Duration              : 0 s
Current Time                    : 0 s
Next Track ID                   : 5
Track Header Version            : 0
Track Create Date               : 2019:07:01 01:23:54
Track Modify Date               : 2019:07:01 01:23:55
Track ID                        : 1
Track Duration                  : 1.87 s
Track Layer                     : 0
Track Volume                    : 0.00%
Image Width                     : 1440
Image Height                    : 1080
Clean Aperture Dimensions       : 1308x980
Production Aperture Dimensions  : 1440x1080
Encoded Pixels Dimensions       : 1440x1080
Graphics Mode                   : ditherCopy
Op Color                        : 32768 32768 32768
Compressor ID                   : avc1
Source Image Width              : 1440
Source Image Height             : 1080
X Resolution                    : 72
Y Resolution                    : 72
Compressor Name                 : H.264
Bit Depth                       : 24
Video Frame Rate                : 29.973
Balance                         : 0
Audio Format                    : lpcm
Audio Bits Per Sample           : 16
Audio Sample Rate               : 1
Layout Flags                    : Mono
Audio Channels                  : 1
Warning                         : [minor] The ExtractEmbedded option may find more tags in the media data
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Media Header Version            : 0
Media Create Date               : 2019:07:01 01:23:54
Media Modify Date               : 2019:07:01 01:23:55
Media Time Scale                : 600
Media Duration                  : 0.00 s
Media Language Code             : und
Gen Media Version               : 0
Gen Flags                       : 0 0 0
Gen Graphics Mode               : ditherCopy
Gen Op Color                    : 32768 32768 32768
Gen Balance                     : 0
Handler Class                   : Data Handler
Handler Vendor ID               : Apple
Handler Description             : Core Media Data Handler
Meta Format                     : mebx
Handler Type                    : Metadata Tags
Content Identifier              : E502A263-F7B0-4311-80C7-5D53B19F2007
GPS Coordinates                 : 48 deg 31' 37.20" N, 35 deg 1' 9.84" E, 72.966 m Above Sea Level
Make                            : Apple
Model                           : iPhone 8 Plus
Software                        : 12.1.2
Creation Date                   : 2018:12:31 20:12:18+02:00
Apple Photos Originating Signature: AUo7fbsC03exqWsCC6eCUTKPMvGx
Image Size                      : 1440x1080
Megapixels                      : 1.6
Avg Bitrate                     : 13 Mbps
GPS Altitude                    : 72.966 m
GPS Altitude Ref                : Above Sea Level
GPS Latitude                    : 48 deg 31' 37.20" N
GPS Longitude                   : 35 deg 1' 9.84" E
Rotation                        : 90
GPS Position                    : 48 deg 31' 37.20" N, 35 deg 1' 9.84" E


StarGeek

One thing to remember is that a lot of video time stamps are supposed to be set to UTC and the program is supposed to adjust this to the local time zone when displayed.

But in this file, the difference is months off, so it's not simply a time zone shift.

Try this command
exiftool -api QuickTimeUTC '-Media*Date<CreationDate' '-Track*Date<CreationDate' '-Quicktime:CreateDate<CreationDate' '-Quicktime:ModifyDate<CreationDate' /path/to/files/

This will copy the CreationDate to the most common video time stamps.  The -api QuickTimeUTC option will adjust the timestamps correctly to UTC.

Optionally, you might also copy the time to the file system time stamps by adding
'-FileModifyDate<CreationDate' '-FileCreateDate<CreationDate'

When listing the data, if you want the times to be adjusted to the local time instead of UTC, you would add -api QuickTimeUTC, the same as when writing.

This command creates backup files.  Add -Overwrite_Original to suppress the creation of backup files.  Add -r to recurse into subdirectories.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

olegdnepr81

Maybe I did somthing wrong but I got date of today for all my files


this is my command for trminal

exiftool -api QuickTimeUTC '-Media*Date<CreationDate' '-Track*Date<CreationDate' '-Quicktime:CreateDate<CreationDate' '-Quicktime:ModifyDate<CreationDate' /Users/olegpysarenko/Desktop/test



Phil Harvey

"got day of today" -- according to what software, and which date?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

olegdnepr81

This is MDLS command :
Last login: Mon Feb  6 22:33:31 on ttys000
olegpysarenko@Olegs-Air ~ % mdls /Users/olegpysarenko/Desktop/test/IMG_4707.MOV 
_kMDItemDisplayNameWithExtensions  = "IMG_4707.MOV"
kMDItemAudioBitRate                = 705
kMDItemAudioChannelCount           = 1
kMDItemCodecs                      = (
    "H.264",
    "Linear PCM",
    "Timed Metadata"
)
kMDItemContentCreationDate         = 2023-02-06 21:17:39 +0000
kMDItemContentCreationDate_Ranking = 2023-02-06 00:00:00 +0000
kMDItemContentModificationDate     = 2023-02-06 21:17:39 +0000
kMDItemContentType                 = "com.apple.quicktime-movie"
kMDItemContentTypeTree             = (
    "com.apple.quicktime-movie",
    "public.movie",
    "public.audiovisual-content",
    "public.data",
    "public.item",
    "public.content"
)
kMDItemDateAdded                   = 2023-02-06 21:17:39 +0000
kMDItemDisplayName                 = "IMG_4707.MOV"
kMDItemDocumentIdentifier          = 0
kMDItemDurationSeconds             = 1.868333333333333
kMDItemEncodingApplications        = (
    "12.1.2"
)
kMDItemFSContentChangeDate         = 2023-02-06 21:17:39 +0000
kMDItemFSCreationDate              = 2023-02-06 21:17:39 +0000
kMDItemFSCreatorCode               = ""
kMDItemFSFinderFlags               = 0
kMDItemFSHasCustomIcon             = (null)
kMDItemFSInvisible                 = 0
kMDItemFSIsExtensionHidden         = 0
kMDItemFSIsStationery              = (null)
kMDItemFSLabel                     = 0
kMDItemFSName                      = "IMG_4707.MOV"
kMDItemFSNodeCount                 = (null)
kMDItemFSOwnerGroupID              = 20
kMDItemFSOwnerUserID               = 501
kMDItemFSSize                      = 3054607
kMDItemFSTypeCode                  = ""
kMDItemInterestingDate_Ranking     = 2023-02-06 00:00:00 +0000
kMDItemKind                        = "QuickTime movie"
kMDItemLatitude                    = 48.527
kMDItemLogicalSize                 = 3054607
kMDItemLongitude                   = 35.0194
kMDItemMediaTypes                  = (
    Video,
    Sound,
    Metadata
)
kMDItemPhysicalSize                = 3055616
kMDItemPixelHeight                 = 1440
kMDItemPixelWidth                  = 1080
kMDItemProfileName                 = "P3 D65 (12-1-6)"
kMDItemStreamable                  = 0
kMDItemTotalBitRate                = 12152
kMDItemVideoBitRate                = 11376
olegpysarenko@Olegs-Air ~ %

and this EXIFTOOL information for same file :
-Air ~ % exiftool /Users/olegpysarenko/Desktop/test/IMG_4707.MOV
ExifTool Version Number         : 12.55
File Name                       : IMG_4707.MOV
Directory                       : /Users/olegpysarenko/Desktop/test
File Size                       : 3.1 MB
File Modification Date/Time     : 2023:02:06 23:17:39+02:00
File Access Date/Time           : 2023:02:06 23:21:59+02:00
File Inode Change Date/Time     : 2023:02:06 23:23:44+02:00
File Permissions                : -rwxrwxrwx
File Type                       : MOV
File Type Extension             : mov
MIME Type                       : video/quicktime
Major Brand                     : Apple QuickTime (.MOV/QT)
Minor Version                   : 0.0.0
Compatible Brands               : qt
Movie Header Version            : 0
Create Date                     : 2018:12:31 18:12:18
Modify Date                     : 2018:12:31 18:12:18
Time Scale                      : 600
Duration                        : 1.87 s
Preferred Rate                  : 1
Preferred Volume                : 100.00%
Preview Time                    : 0 s
Preview Duration                : 0 s
Poster Time                     : 0 s
Selection Time                  : 0 s
Selection Duration              : 0 s
Current Time                    : 0 s
Next Track ID                   : 5
Track Header Version            : 0
Track Create Date               : 2018:12:31 18:12:18
Track Modify Date               : 2018:12:31 18:12:18
Track ID                        : 1
Track Duration                  : 1.87 s
Track Layer                     : 0
Track Volume                    : 0.00%
Image Width                     : 1440
Image Height                    : 1080
Clean Aperture Dimensions       : 1308x980
Production Aperture Dimensions  : 1440x1080
Encoded Pixels Dimensions       : 1440x1080
Graphics Mode                   : ditherCopy
Op Color                        : 32768 32768 32768
Compressor ID                   : avc1
Source Image Width              : 1440
Source Image Height             : 1080
X Resolution                    : 72
Y Resolution                    : 72
Compressor Name                 : H.264
Bit Depth                       : 24
Video Frame Rate                : 29.973
Balance                         : 0
Audio Format                    : lpcm
Audio Bits Per Sample           : 16
Audio Sample Rate               : 1
Layout Flags                    : Mono
Audio Channels                  : 1
Warning                         : [minor] The ExtractEmbedded option may find more tags in the media data
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Media Header Version            : 0
Media Create Date               : 2018:12:31 18:12:18
Media Modify Date               : 2018:12:31 18:12:18
Media Time Scale                : 600
Media Duration                  : 0.00 s
Media Language Code             : und
Gen Media Version               : 0
Gen Flags                       : 0 0 0
Gen Graphics Mode               : ditherCopy
Gen Op Color                    : 32768 32768 32768
Gen Balance                     : 0
Handler Class                   : Data Handler
Handler Vendor ID               : Apple
Handler Description             : Core Media Data Handler
Meta Format                     : mebx
Handler Type                    : Metadata Tags
Content Identifier              : E502A263-F7B0-4311-80C7-5D53B19F2007
GPS Coordinates                 : 48 deg 31' 37.20" N, 35 deg 1' 9.84" E, 72.966 m Above Sea Level
Make                            : Apple
Model                           : iPhone 8 Plus
Software                        : 12.1.2
Creation Date                   : 2018:12:31 20:12:18+02:00
Apple Photos Originating Signature: AUo7fbsC03exqWsCC6eCUTKPMvGx
XMP Toolkit                     : Image::ExifTool 12.55
Media Event Id Date             : 2018:12:31 20:12:18+02:00
Media Data Size                 : 3037220
Media Data Offset               : 17387
Image Size                      : 1440x1080
Megapixels                      : 1.6
Avg Bitrate                     : 13 Mbps
GPS Altitude                    : 72.966 m
GPS Altitude Ref                : Above Sea Level
GPS Latitude                    : 48 deg 31' 37.20" N
GPS Longitude                   : 35 deg 1' 9.84" E
Rotation                        : 90
GPS Position                    : 48 deg 31' 37.20" N, 35 deg 1' 9.84" E
olegpysarenko@Olegs-Air ~ %

why MDLS cant show the same date information ( any information about 2018 year)

Phil Harvey

Two things:

1) The metadata daemon doesn't process files immediately, so there may be some delay before the mdls items update.

2) (and probably the real problem) You should also set FileModifyDate and FileCreateDate because these seem to be what mdls is reading.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

olegdnepr81

Thank you so much for your help StarGeek and Phil Harvey!

I use this :
exiftool -Overwrite_Original -api QuickTimeUTC '-FileModifyDate<CreationDate' '-FileCreateDate<CreationDate' '-Media*Date<CreationDate' '-Track*Date<CreationDate''-Quicktime:CreateDate<CreationDate' '-Quicktime:ModifyDate<CreationDate' /Users/olegpysarenko/Desktop/test/
and it works!

systemlordanubis

Hi All,

Thank you Phil for this wonderful tool.

I've been trying to follow the advice in this and other threads for modifying the dates/times on files.  I've been trying to extract .mov or .mp4 files from GoPro 360 files and I need to change the timestamp to match the GPS export data.

However, when I run this command:
exiftool.exe -Overwrite_Original -api QuickTimeUTC "-FileModifyDate<CreationDate" "-FileCreateDate<CreationDate" "-Media*Date<CreationDate" "-Track*Date<CreationDate" "-Quicktime:CreateDate<CreationDate" "-Quicktime:ModifyDate<CreationDate" "S:\Path\To\File.mp4"
I get this error:
Warning: No writable tags set from S:\Path\To\File.mp4
    0 image files updated
    1 image files unchanged


The file is writable, when I tested with a more simple command, it works:
exiftool.exe -filecreatedate="2023-10-15T04:57:39.324Z" S:\Path\To\File.mp4
These are the timestamps listed in the file:
exiftool.exe -a -G -time:all -s S:\Path\To\File.mp4
[File]          FileModifyDate                  : 2023:10:15 15:57:39+11:00
[File]          FileAccessDate                  : 2024:09:21 14:43:00+10:00
[File]          FileCreateDate                  : 2023:10:15 15:57:39+11:00
[QuickTime]     CreateDate                      : 2023:10:15 04:57:39
[QuickTime]     ModifyDate                      : 2023:10:15 04:57:39
[QuickTime]     TrackCreateDate                 : 2024:09:20 16:06:55
[QuickTime]     TrackModifyDate                 : 2024:09:20 16:06:55
[QuickTime]     MediaCreateDate                 : 2024:09:20 16:06:55
[QuickTime]     MediaModifyDate                 : 2024:09:20 16:06:55
[QuickTime]     TrackCreateDate                 : 2024:09:20 16:06:55
[QuickTime]     TrackModifyDate                 : 2024:09:20 16:06:55
[QuickTime]     MediaCreateDate                 : 2024:09:20 16:06:55
[QuickTime]     MediaModifyDate                 : 2024:09:20 16:06:55
[QuickTime]     TrackCreateDate                 : 2023:10:15 15:41:23
[QuickTime]     TrackModifyDate                 : 2023:10:15 15:41:23
[QuickTime]     MediaCreateDate                 : 2023:10:15 15:41:23
[QuickTime]     MediaModifyDate                 : 2023:10:15 15:41:23
[QuickTime]     DateTimeOriginal                : 2023:10:15 04:57:39.324Z
[XMP]           DateTimeOriginal                : 2023:10:15 04:57:39.324Z
[XMP]           CreateDate                      : 2023:10:15 04:57:39.324Z
[XMP]           ModifyDate                      : 2023:10:15 04:57:39.324Z

Any help or pointers in the right direction would be greatly appreciated.
Thank you.