Tag: copy "Date Created" to Comment

Hi there!

In the near future, I expect to get a new laptop. Now, I want to secure the creation date of my music files. I have changed music player quite some times (iTunes, WinAmp, etc.), so I have no valid info in any music library.

As far as I can see the best solution is to copy the Date Created stamp on my music files (as seen in windows) to the comment tag field. For sorting purposes, I would the format of the date in the comment field to be yy-mm-dd, time.

I expect some of the following must be used:


%_file_create_date% - Short creation date
%_file_create_datetime% - Long creation date
%_file_create_datetime_raw% - Long creation date (unformatted),

but I can not figure out how to use this in e.g. an action.

Please help! Thx, Harald

This is my first post here, please be gentile :wink:

Hi there,

I found a possible solution myself, create
Action for Format value with
Field set to COMMENT and
Format string to
$mid(%_file_create_datetime%,7,4)-$mid(%_file_create_datetime%,4,2)
-$mid(%_file_create_datetime%,1,2), $mid(%_file_create_datetime%,12,8)

This results in 2007-12-04, 13:35:12 for the comment in the music tag on my system.
For sorting purposes, only numbers is probably more robust.
For 20071204133512, just leave out the "-" and ", ".

Voilà!

Thx for a great piece of software!

Take a look to system fields which might give the better result of last modification datetime:
%_file_mod_date%,
%_file_mod_datetime%,
and this is for sorting purposes:
%_file_mod_datetime_raw%.

DD.20071204.1635.CET

I'm looking for some help with a string, I am trying to get a format string to work with %_file_create_date%. I am trying to turn 1/25/2008 into 20080125 to use in foobar as a sort method can anyone help me out?

You can use %_file_create_datetime_raw% directly whithout any formatting if it's only about sorting.

Well I have a column to see when the date was added to so the raw dont work so well. I'm sure with Harald's string properly formated with %_file_create_date% to output yearmonthday it would work but I have no idea how to accomplish that.

Although it is not clear what you really need (a formatstring or an outputstring from a system varable or whatever else), I want to put in another proposal.

Convert from date format 'dd.mm.yyyy' to 'yyyymmdd':

$num($regexp(%_file_create_date%,'^(\d+)\.(\d+)\.(\d\d\d\d)$','$3'),4)$num($regexp(%_file_create_date%,'^(\d+)\.(\d+)\.(\d\d\d\d)$','$2'),2)$num($regexp(%_file_create_date%,'^(\d+)\.(\d+)\.(\d\d\d\d)$','$1'),2)

... or ...

$regexp($regexp(%_file_create_date%,'^(\d\d?)\.(\d\d?)\.(\d\d\d\d)$','0000$3-00$2-00$1'),'0*(\d\d\d\d)-0*(\d\d)-0*(\d\d)','$1$2$3')

Convert from date format 'mm/dd/yyyy' to 'yyyymmdd':

$num($regexp(%_file_create_date%,'^(\d+)\/(\d+)\/(\d\d\d\d)$','$3'),4)$num($regexp(%_file_create_date%,'^(\d+)\/(\d+)\/(\d\d\d\d)$','$1'),2)$num($regexp(%_file_create_date%,'^(\d+)\/(\d+)\/(\d\d\d\d)$','$2'),2)

... or ...

$regexp($regexp(%_file_create_date%,'^(\d\d?)/(\d\d?)/(\d\d\d\d)$','0000$3-00$1-00$2'),'0*(\d\d\d\d)-0*(\d\d)-0*(\d\d)','$1$2$3')

DD.20080131.1525.CET

Thanks a lot for this Harald, it worked great. Mp3Tag is unbelievably helpful for this kind of thing.

Now I can finally get my platform nonspecific XSPF playlists organised by when I added the songs. :music:

So I used this and it worked great, but unfortunately on Windows Explorer and iTunes, the comments field defaults to any tag called COMMENTS + SOMETHING ELSE before the standard comments.


I deleted all of these other comments fields, and I haven't had any problems so far. Just add your entire library to MP3TAG, select all, Right click on the files and choose extended tags. Select any tag starting with COMMENT (but not the original COMMENT tag) and click the cross to delete. I haven't had any problems yet.