formatting custom tags

hi there everyone,

I've been working on a creative use of %file_create_date% to determine when the media was added to the collection but it seems I'm going through a lot of steps and am looking for suggestions to maybe do a one-pass.

(background info, using minimserver, kinsky, Linn DS)

I'm using Guess Values "%_file_create_date%": %month_added%/%day_added%/%year_added% to create tags for each value so I can sort down quickly by year or month.

I also copy %file_create_date% into a tag called %create_date% and in minimum server use "-create_date" index tag for a reverse lookup which provides a good overview of all import dates.

problems encountered, the index comes up in raw %file_create_date% format which is mm/dd/year and really should be year/mm/dd for the index to work nicely.

I tried using a few functions to achieve the reformat and force leading zeros on month and day

format value: %create_date%": %year_added%/$num(%month_added%,2)/$num(%month_added%,2) <_this didn't work

so far for the easy approach

then I tried using some string formatting (right, left) but because of the single or double digits this would not work as well.

It seems I am not understanding which functions work on which action types, or I am just making some essential typo errors.

could anyone point me in the right direction?

The format value action should not have a subset of functions.
What I would assume: the evaluation of the date relies on your local settings for measurements and units. And if this setting determines the sequence of year, month and day, you will not be able to alter that sequence.

(Wir koennen auch in Deutsch weiter, wann es zu komplex wird)

The %file_create_date% information field is copied directly, and building an index tag on it alone results in a text sort of the date which results in listing all dates for instance for 9, whether its 2013 or 2014 because the index is working on the text ascii value.

I think my approach won't work So I have to reformat with the year first, then month, then date and the index will work but then I have the problem with first converting single character months to double, then using the filter functions.

so what you are saying is I cannot use multiple functions and must do this in 2 steps?

You can check the format string in the
Convert>Tag-Tag
function.
I tested it and it produces the two-digit-numbers just as you intended.
In what way doesn't the format value function produce the correct result?

What I would like to point out: If you assign the newly formatted date to a field that really is a field for a date and not just a string, then if could be that a date is expected in the format which is used by the OS. In Germany, this would be dd.mm.yyyy. If you re-format that field to yyyy-mm-dd then it could be that the date evaluation function does not find the right data in the correct position in the date. Plainly speaking: there is no day 2014... do you see what I mean?

thanks Ohrenkino,

I have tested convert-Tag-Tag, and the preview and everything works but it does not write the result in %create_date% (maybe a bug?)

%create_date%, %month_added%, %Day_added%, and %year_added% are all valid and showing content in their columns, when I try to push this tag value it just appears blank but the preview showed it to be valid and working.

minimum server does not know this is a date field, it is text only and treated as text for the index so this cannot be a date format mismatch for the data type in my opinion.

I still don't know if i'm doing something wrong because it seems to be right but doesn't work.

Could you check 2 thing:
After the "format value" action, please open the Extended Tags dialogue (Alt-T) and check if there is a field which sort of could be the one with the new date?

The other thing: could you open the extended tags dialogue (again) and create the field with the "new" button. This should prove that it is possible in principle to create the field.

I think it was because I was consistent in using %var% parenthesis' when I should have just put the var name in the field.

Thanks for the Alt-T typ, that really made things clearer.

can you confirm when %var% is to be used and when only var?

vielen dank und gruesse aus Kanada

If you refer to the contents then use %var%.
If you refer to the address ("from all the fields that I have please use the one I name now") then use the plain name.
So, I take it that Extended Tags showed "%create_date%" as name instead of only "create_date"?

Mp3tag offers different ways to reach the goal. Here is one.
For a given DateTime string, in the following example, having international ISO 8601 format, it is rather easy to split the string into each subvalue into a Mp3tag variable.

For example ...

Action "Format value" Field: TMP_DT_CREATED Formatstring: $replace(%_file_create_datetime%,'-','\\\\',' ','\\\\',':','\\\\') ... gives ... TMP_DT_CREATED(0)..TMP_DT_CREATED(5) %_file_create_datetime% is '2014-09-21 12:34:56' $meta(TMP_DT_CREATED,0) is '2014' $meta(TMP_DT_CREATED,1) is '09' $meta(TMP_DT_CREATED,2) is '21' $meta(TMP_DT_CREATED,3) is '12' $meta(TMP_DT_CREATED,4) is '34' $meta(TMP_DT_CREATED,5) is '56'

If your computer DateTime setting differs from the international standard, then you have to adapt the proposal to your needs.

See also ...
Turn D/M/YYYY into YYYY/MM/DD

DD.20140921.1056.CEST

that is correct, and then it made sense

thanks DetlevD, I was more interested in the info tag of file_create_date so I can build an index of when the media joined the collection (was written to the store)

regards,

Jake

I do not understand, didn't you ask how to use the system info variable %_file_create_datetime% ?
What do you mean with "info tag of file_create_date"?
Maybe you want to use the system info variable %_file_mod_datetime%?

Ah, I see, you wanted the system info variable %_file_create_date% or %_file_mod_date%, which delivers only the date.
But where is the problem? My proposal does work the same way for this value too.

Action "Format value" Field: TMP_DATE_CREATED Formatstring: $replace(%_file_create_date%,'-','\\\\') ... gives ... TMP_DATE_CREATED(0)..TMP_DATE_CREATED(2) %_file_create_date% is '2014-09-21' $meta(TMP_DATE_CREATED,0) is '2014' $meta(TMP_DATE_CREATED,1) is '09' $meta(TMP_DATE_CREATED,2) is '21'

Note: Depending on your system's time setting, the order of the year, month, day may differ from this example ... and the $replace function needs to be adjusted to use the actual date separator character.

DD.20140921.1639.CEST

yes, I was looking for %file_create_date% and your solution will definitely work towards doing a one pass solution. Currently I use guess value to break out a day_created, Month_created, year_created, then assemble them with convert tag->tag formatting. I am not trying to stamp them with current system date or time.

the idea is, I have a large collection of music, but their date is when the album was released and not when I added them to the collection.

I find this very useful to show me my "new music added" regardless of when the album was produced and found the %file_create_date% very useful for this.

thanks for your help, I'll be working on a single pass solution to integrate in all of my cleanup automation.