Format %_date% to YYYY-MM-DD with leading zeros?

I'm wanting to use the %_date% placeholder for one of my tags, but I want to convert it to ISO date format YYYY-MM-DD. Two issues though are that %_date% doesn't use leading zeros for single-digit months, and there are no field separators between the three fields. So currently, %_date% = 692024 where I would like 2024-06-09. I'm familiar with RegEx, but I've not come across one like this before. Ideas?

So you would never know for 1122024 whether it should be 11-02-2024 or 01-12-2024?

According to the ID3 standard, there are these 4 tags for DATE and YEAR.

None of them includes a format like MDYYYY or DMYYYY.

TYER
The 'Year' frame is a numeric string with a year of the recording. This frames is always four characters long (until the year 10000).

TORY
The 'Original release year' frame is intended for the year when the original recording, if for example the music in the file should be a cover of a previously released song, was released. The field is formatted as in the "TYER" frame.

TDAT
The 'Date' frame is a numeric string in the DDMM format containing the date for the recording. This field is always four characters long.

TRDA
The 'Recording dates' frame is a intended to be used as complement to the "TYER", "TDAT" and "TIME" frames. E.g. "4th-7th June, 12th June" in combination with the "TYER" frame.

In which case your %_date% placeholder contains MDYYYY or DMYYYY?

And even the use of the dynamic variable %_date% returns a fully formatted date on my machine:
grafik

could it be that this depends on your OS date settings?

Yes it seems to depend on what you have set here in your regional Windows DATE format settings:

If you reduce the short date format to T.M.JJJJ you get a %_date% like 6.9.2024
With a format like TT.MM.JJJJ you get a %_date% like 06.09.2024

Could it be that the OP is using a short date format like
MDYYYY
or
DMYYYY
in his (english) Windows regional date time format settings?

In this case we could explain how a %_date% could be shown as 692024

Try $regexp(692024,(\d)(\d)(\d\d\d\d),$3-0$2-0$1)
to get
2024-09-06

Calendar Choose Format
Hello ShatteredGlass

I recently worked on a draft calendar for my project in Mp3tag which I placed in a Tools:

You can choose the date from the calendar and convert it to the format you want:
YYYY/MM/DD
YYYY-MM-DD
YYYY.MM.DD
etc...

If you are interested, I can send you the file...

@LyricsLover
@ohrenkino

YES! Indeed the %_date% placeholder is using the "Short date" format from the Windows Region settings. I've changed it to ISO format and now the %_date% placeholder is working as I want....

However, this now means that the date showing in the bottom right corner of my screen is now using this format also. This doesn't really bother me, but now I'll have to see what else changing this setting might impact in other areas of the OS. I'm not really a fan of having to workaround the issue like this. Would be nice if there was still a way to get YYYY-MM-DD in Mp3tag, without having to change the Region settings in Windows.

This works great if you're going to be manually specifying the date, unfortunately, it doesn't actually work when used with the %_date% placeholder....

Tag - Filename 06-10-2024 12.37.07

I wonder if there is another way to wrap that regex with another regex to get that to work with %_date%?

Works over here:
grafik

You would have to cater for your new format and add the separators as well.

Works over there because you have your Region settings set to something other than the default. Well the default for a US/English installation of Windows anyways...

What do you get if you enter %_date% in Convert>Tag-Tag?

Default "Short Date"

Modified Short Date

If you use the slash in Convert>Tag-Filename then it gets removed as the slash is no valid character for a file name.
That is why I asked for Convert>Tag-Tag.

My bad...

So if you keep your standard date format looking like
6/10/2024
then try:
$regexp(%_date%,(\d+)/(\d+)/(\d\d\d\d),$3)-$num($regexp(%_date%,(\d+)/(\d+)/(\d\d\d\d),$1),2)-$num($regexp(%_date%,(\d+)/(\d+)/(\d\d\d\d),$2),2)

(where you replace the fixed date with %_date%.
You have to cut out every part of the date and then set the padding.

Please remove the apostrophes in front of and behind %_date%

You did it! It works!

$regexp(%_date%,(\d+)/(\d+)/(\d\d\d\d),$3)-$num($regexp(%_date%,(\d+)/(\d+)/(\d\d\d\d),$1),2)-$num($regexp(%_date%,(\d+)/(\d+)/(\d\d\d\d),$2),2)

Of course my excitement was short lived as I just now realized that placeholders don't work with Tag Panel entries... SMH

1005