Using _file_mod_datetime to change file's mod timestamp?


I tried setting up a couple of actions to do as the title states, and well in short, it didn't work...
Just taking a stab in the dark to ask whether it is possible to use _file_mod_datetime (or any other attribute) to change file's mod timestamp?

As an example, I would like to set the file modification timestamp to the value I have stored in the %year% tag.


You cannot change file time stamps from within Mp3tag as you will.

You can try to reach your goal using "Total Commander" with "Anytag" plugin.

Work Instruction

1. Necessary requirements.
Mp3tag installed.
Total Commander with content plugin "anytag.wdx" installed.

2. If not already done, then edit the text file "anytag.any".

... or ...

... append a user defined tag field of datatype string (8) into "anytag.any",
e. g. "8|Extra_DateTime|%Extra_DateTime%"
... and use this new tag field further on in the process.

If changes were made to the "anytag.any" file, then Total Commander must be restarted to reflect the changes.

3. Prepare the media files using Mp3tag.
Use the existing tag field "YEAR"
... or ...
... create a user defined tag field "EXTRA_DATETIME" in each file.

The Mp3tag tag field "YEAR" (... respectively "EXTRA_DATETIME") must have a format, which Total Commander can accept as proper data to set file time attributes.

Fill the tag field with the necessary data.

The format of the DateTime data string can be one of the following formats:

The format of the DateTime string might depend on your local computer DateTime settings.
Above DateTime format examples work on a computer set accordingly to ISO 8601.

4. Use Total Commander with Anytag plugin.
Select the file to work on.
Open menu option to change file atributes.
In the upcoming dialog choose "Plugin/More Attributes"
A new line with edit fields comes up.
Plugin "tc" "comment" is already filled in.
Press the "+" button, choose a field name "anytag>Year" (... or ... "anytag>Extra_DateTime").
Change plugin tc property to "Create Date" or "Modification Date" as you need it.

(Note: This "More Attributes" dialog's behaviour is somewhat strange and might carry a bug or more, because the fields from the anytag plugin are sometimes not displayed in the field list.
But doing the steps as described before will work.)

If the changes to the dialog are made, then press "OK".
Total Commander will make the changes to the selected files.

There will come up a warning message in case of DateTime format is not correct.
Then press "Abort" and make sure (... use Mp3tag) that all DateTime strings in the tag fields "YEAR" (... respectively "EXTRA_DATETIME") have an acceptable correct format.
Repeat step 4.

5. Check result.
To check what changes are made to the file, select the file in Total Commander, press "Alt+Enter".
A properties dialog window comes up, which displays the three file related DateTime values: Create DateTime, Modified DateTime, Last Access DateTime.

6. Ready.


Strange... Doesn't seem to work for me; Using TC 7.50a, and wdx_anytag_098, Total Commander doesn't seem to see the MP4 tags (as tagged by MP3Tag)...

I setup columns of Year atom (YYYY-MM-DDT12:00:00), and Album as columns in TC, and they're both coming up as empty...

At first try to rework the provided workflow instructions from above, which works for mp3 files.

If the workflow runs fluently for you too, then you can make your experiments with other file types, e. g. mp4, or with other DateTime strings like "YYYY-MM-DDT12:00:00".
You should combine and apply your things so that they can work together.

Quote from anytag Readme.txt:

Reading MP4 is supported, so you should see any content in TC / Mp3tag configured user defined view.

Are you able to change file DateTime property by manual inputting DateTime data into the TC plugin's dialog editfield? (e. g. taking DateTime "from the file under the cursor", note the format).

If not, then your DateTime string from the YEAR tagfield does not fit to the format or content of which TC would expect.

Good luck!
Please report and share your elaborations.


The ability to set file modification times and do date/time calculations from within Mp3tag actions is something that I could really use.

I would love to be able to preserve a file modification time without having to go into the Options and constantly check and uncheck the option. IMO it shouldn't be necessary to go into Options to perform common everyday tasks. It's a workflow killer. The other prime example is the awkward way tag deletions are handled. If you want to remove all tags from an MP3 file you have to go into Options, check all tag types under Tags > Mpeg > Remove, do your Ctrl+R, then go back into Options to uncheck the added tag types. Program options should not be used like that.

The other thing that being able to manipulate file modification times would enable is to 'bump' the file mod time by a few seconds or minutes, so that I could permit the modification time to be changed, but not to the current date & time. This would be helpful for programs that use the date last modified to sort 'new' music. By bumping the mod time I could keep the overall order of albums added to my library, but still permit cataloging programs to see that a file has changed. If you preserve the same modification time and the file size doesn't change, then most software will not be able to tell that the file has changed and won't re-read the file's tags to update its internal database.

Using an action "Format value" you can create an user defined tag field and fill it with the file modification DateTime.

Well, sometimes I feel like you, but sometimes I am satisfied with this way back around.
Direct handling of Tag types is an important task, and should be located in the expert area of Mp3tag. This can help to open the eyes and switch on the brain before running blindly into an accident.

Hmm ... do you know for sure if this is really possible to set the modification file time into the future in relation to the last access file time?


I've just stumbled over a commandline tool ...

TouchMax changes the CreationTime or ModifiedTime of files and folders.

... cannot say anything about this thing ...
... but I assume that it could be useful as a plugin tool in Mp3tag.


I'm sure that Windows will allow you to set the modification time of a file into the future, but that's not really what I'd be doing. I would use it to change something like:

2007-10-22 23:17:04


2007-10-22 23:17:05

This way, the date/time doesn't really change for practical purposes, but any music library software will see a different modification time and should re-read the metadata.

My question was intended to make sure if it is possible to set the Modification DateTime newer than the Last Access DateTime.
If so, then a watcher system should signal a change.


Sure, it's possible. Windows doesn't care.