# %year% returning two different values for the same file

**URL:** <https://community.mp3tag.de/t/year-returning-two-different-values-for-the-same-file/16254>\
**Category:** Support\
**Created:** [October 22, 2014, 4:02am UTC](https://community.mp3tag.de/t/year-returning-two-different-values-for-the-same-file/16254 "2014-10-22T04:02:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tre0n](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/ac8455/32.png) [@Tre0n](https://community.mp3tag.de/u/Tre0n)\
**Post date:** [October 22, 2014, 4:02am UTC](https://community.mp3tag.de/t/year-returning-two-different-values-for-the-same-file/16254/1 "2014-10-22T04:02:58Z")

</div>

I'm working on a filter to reorganise a massive music library, which is currently this (still WIP):

```
F:\Music\$left($if2(%albumartist%,%artist%),1)\$if2(%albumartist%,%artist%)\\%year%$if(%date%,-$cutLeft(%date%,2)$if($eq($len(%date%),4),-$cutRight(%date%,2),),) ~ %album%\$left(%artist%,1)$left($right(%artist%,$sub($len(%artist%),$strrchr(%artist%, ))),1)[-%year%][$num(%discnumber%,2)-]$num(%track%,2) - %title%

```

Indented for readability:

```
F:\Music
    \$left($if2(%albumartist%,%artist%),1)
        \$if2(%albumartist%,%artist%)
            \\%year%$if(%date%,-$cutLeft(%date%,2)$if($eq($len(%date%),4),-$cutRight(%date%,2),),) ~ %album%
                \$left(%artist%,1)$left($right(%artist%,$sub($len(%artist%),$strrchr(%artist%, ))),1)[-%year%][$num(%discnumber%,2)-]$num(%track%,2) - %title%

```

The parts I'm concerned with are these:

```
%year%$if(%date%,-$cutLeft(%date%,2)$if($eq($len(%date%),4),-$cutRight(%date%,2),),)

```

Which displays the date as YYYY-MM-DD format (if this looks unnecessarily complicated, read on). %date% here seems to return MMDD from the date.

And this:

```
$left(%artist%,1)$left($right(%artist%,$sub($len(%artist%),$strrchr(%artist%, ))),1)[-%year%]

```

Which displays the first letter of the first and last word in the Artist field, followed by year as YYYY.  
(E.g. "Arjen Anthony Lucassen", "2012" -\> "AL-2012")

My issue is this:  
In the first code snippet, %year% returns "2012". In the second one, it returns "2012-04-20", which is what I wrote all that other gobbledigook to display. (It also managed to display exactly the format I didn't want, both times ![<_<](https://community.mp3tag.de/uploads/default/original/1X/5996dbb474c88b8f9fc49f09dc3858d081055a2d.gif "<\_<") )

I haven't really tested much to reproduce this behaviour (just writing "[-%year%]" anywhere else doesn't work), but it's very strange.

Can anyone shed light on this issue? Is the %year% field supposed to display YYYY, YYYY-MM-DD or something else? In the documentation it just says "Year".

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [October 22, 2014, 4:12am UTC](https://community.mp3tag.de/t/year-returning-two-different-values-for-the-same-file/16254/2 "2014-10-22T04:12:50Z")

</div>

AFAIKT there is some information about DATE and YEAR if you have a look at the changelog  
[http://www.mp3tag.de/en/changelog.html](http://www.mp3tag.de/en/changelog.html)  
for Version 2.58 and 2.59

Perhaps this sheds some light.

---

<div class="post-metadata">

**Author:** ![Tre0n](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/ac8455/32.png) [@Tre0n](https://community.mp3tag.de/u/Tre0n)\
**Post date:** [October 22, 2014, 4:45am UTC](https://community.mp3tag.de/t/year-returning-two-different-values-for-the-same-file/16254/3 "2014-10-22T04:45:49Z")

</div>

It does, thanks.

I've got foobar2000 set to use ID3v2.3, so it's saving the full date in TYER. I gather from that changelog that in Mp3tag, %date% fetches the TDAT tag, which isn't mentioned in foobar2000's [tag mapping documentation](http://wiki.hydrogenaud.io/index.php?title=Foobar2000:ID3_Tag_Mapping). As far as I can tell, TDAT doesn't exist in my files at all, so I don't know where %date% is getting it's information from, or why %year% has changed on me.

I guess I'm still confused. Enlightened, but still confused.

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [February 9, 2026, 12:25pm UTC](https://community.mp3tag.de/t/year-returning-two-different-values-for-the-same-file/16254/4 "2026-02-09T12:25:20Z")

</div>

Closed on February 9, 2026, 12:25pm UTC


