Unofficial archive. This is a read-only, community-run archive of the Apple Support Community. It is not affiliated with or endorsed by Apple Inc.

Change creation date of a VIDEO file using terminal command touch

Hi guys! I am trying to change the creation date (Mac Ventura) in a terminal with the command touch -t YYYYMMDDHHMM, and it works, but the issue with this command is that there are no SECONDS. A new date created automatically shows seconds as 00.

I tried the format YYYYMMDDHHMMSS but it does not work. Does anyone know similar command to change creation date for video files? Thanks in advance.


3 replies

Alternatively you can use setfile to adjust creation [d] and modification [m] dates independently ("setfile" is included in Xcode Command Line Tools install).


setfile -h


setfile -d '01/15/2000 23:50:11' -m '01/15/1999 23:50:11' movie.mp4


BTW when using setfile via exiftool commands I noticed that unlike earlier Xcode versions, Xcode 6 fails if there are time zones in the input. exiftool 13.02 and later patched this so such old exiftool commands work again.


https://exiftool.org/forum/index.php?topic=15578.msg89427#msg89427

Thanks for sharing & following up.


FYI, you can usually get more information on how to use a command by looking at its help or manual page by using the "man" command or sometimes by adding the option " -h ", or " --help" to the command (the latter will usually be a short summary, so using "man" is best since some commands may use the " -h" option for something else).


For example:

man  touch

I have sorted it out!!


If anyone is interested: the seconds can be added via a dot:


touch -t YYYYMMDDHHMM.SS /Filename...


:)