Help - Search - Members - Calendar
Full Version: Tag: copy "Date Created" to Comment
Mp3tag Forums > Mp3tag - International > Support
Harald
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 ;-)
Harald
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!
DetlevD
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
TsiAwd
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?
Florian
You can use %_file_create_datetime_raw% directly whithout any formatting if it's only about sorting.
TsiAwd
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.
DetlevD
QUOTE (TsiAwd @ Jan 31 2008, 01:41) *
... formated with %_file_create_date% to output yearmonthday ...

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$2-00$1'),'0*(\d\d\d\d)-0*(\d\d)-0*(\d\d)','$1$2$3')

DD.20080131.1525.CET
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.