# 'Length' tab \> minutes and seconds

**URL:** https://community.mp3tag.de/t/length-tab-minutes-and-seconds/63784
**Category:** Support
**Created:** [February 15, 2024, 7:32pm UTC](https://community.mp3tag.de/t/length-tab-minutes-and-seconds/63784 "2024-02-15T19:32:54Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![kwil](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/9de0a6/32.png) [@kwil](https://community.mp3tag.de/u/kwil)
#### Post date: [February 15, 2024, 7:32pm UTC](https://community.mp3tag.de/t/length-tab-minutes-and-seconds/63784/1 "2024-02-15T19:32:54Z")

</div>

Hello....  
I've just today updated to the latest version of the excellent **MP3 TAG (64-bit)** version

However, for some time now, I've had a a minor irritation with **DISPLAY OF TRACK TIME** ie under 'Length' tab

I want to lose the 'leading zero' so that, say, **04:06 \> 4:06**

Right-clicking 'Length' \> Customize Columns: in the 'Value' box at the right, the default is: **%\_length%**

I'm assuming that will have to change but to what exactly?

Can anyone help?

Many thanks

---

<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: [February 15, 2024, 7:42pm UTC](https://community.mp3tag.de/t/length-tab-minutes-and-seconds/63784/2 "2024-02-15T19:42:54Z")

</div>

If you use %\_length% as is, then the definition from the documentation

> **[Format Strings and Placeholders – Mp3tag Documentation](https://docs.mp3tag.de/format/)**
>
> Documentation on format strings and placeholders to describe the structure of file names and imported data. Mp3tag is the universal Tag Editor.

applies:  
`%_length%` Length (formatted)  
If you do not like that, you would have to create your own format string.  
It is up to you to determine if loosing that leading zero is worth the effort.

---

<div class="post-metadata">

### Author: ![kwil](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/9de0a6/32.png) [@kwil](https://community.mp3tag.de/u/kwil)
#### Post date: [February 15, 2024, 7:54pm UTC](https://community.mp3tag.de/t/length-tab-minutes-and-seconds/63784/3 "2024-02-15T19:54:44Z")

</div>

Hi ohrenkinko..

Thanks for the prompt reply. 🙂

However I can't see any format string in the 'Documentation' link you posted that would help me 'create' what I want.  
Any other suggestions welcome...

Many thanks

---

<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: [February 15, 2024, 7:58pm UTC](https://community.mp3tag.de/t/length-tab-minutes-and-seconds/63784/4 "2024-02-15T19:58:00Z")

</div>

> [@kwil](#):
>
> However I can't see any format string in the 'Documentation' link

The linked documentation referred to the definition of \_LENGTH.  
There is no readymade format string.  
You would have to create your own formatting if you do not want to take the existing formatted time.  
I would think it would require the length in seconds to be divided and separated into minutes and seconds and format each part indivdually

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [February 15, 2024, 8:03pm UTC](https://community.mp3tag.de/t/length-tab-minutes-and-seconds/63784/5 "2024-02-15T20:03:26Z")

</div>

Are you looking for something like this:

 ![image](https://community.mp3tag.de/uploads/default/original/3X/8/d/8db3df92617e9df03a470881501c30fc8d7b90b7.png)

The mathematical formula for the field Value would be something like this for the HH (hours):MM (minutes):SS (seconds).  
`$ifgreater($div(%_length_seconds%,3600),0,$div(%_length_seconds%,3600):,)$ifgreater($div($mod(%_length_seconds%,3600),60),0,$div($mod(%_length_seconds%,3600),60):,)$mod($mod(%_length_seconds%,3600),60)`

The problem will be to find a solution for the wanted(?) zero for the minutes and/or seconds like in the above example for `3:07`

---

<div class="post-metadata">

### Author: ![ryerman](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ryerman/32/5285_2.png) [@ryerman](https://community.mp3tag.de/u/ryerman)
#### Post date: [February 15, 2024, 8:54pm UTC](https://community.mp3tag.de/t/length-tab-minutes-and-seconds/63784/6 "2024-02-15T20:54:29Z")

</div>

> [@kwil](#):
>
> I'm assuming that will have to change but to what exactly?

Try this: `$trimLeft(%_length%,0)`  
But you may not like what the result is for tracks shorter than 1 minute.

> **[Scripting Functions – Mp3tag Documentation](https://docs.mp3tag.de/scripting/#string-functions)**
>
> Documentation on Mp3tag's scripting functions. Mp3tag is the universal Tag Editor.

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [February 15, 2024, 9:52pm UTC](https://community.mp3tag.de/t/length-tab-minutes-and-seconds/63784/7 "2024-02-15T21:52:56Z")

</div>

> [@ryerman](#):
>
> Try this: `$trimLeft(%_length%,0)`  
> But you may not like what the result is for tracks shorter than 1 minute.

You could further enhance this with some IF conditions to check the raw track length to decide when to trim or not. Lots of options to get the display as you prefer.

---

<div class="post-metadata">

### Author: ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)
#### Post date: [February 16, 2024, 6:14am UTC](https://community.mp3tag.de/t/length-tab-minutes-and-seconds/63784/8 "2024-02-16T06:14:24Z")

</div>

> [@ryerman](#):
>
> Try this: `$trimLeft(%_length%,0)`  
> But you may not like what the result is for tracks shorter than 1 minute.

As always there is more than one way to skin a cat.  
`$num(%_length%,1):$right(%_length%,2)`

That works for tracks up to 59 minutes.  
But anyway, I think anything without the leading zero in front looks odd.

---

<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: [February 16, 2024, 9:13am UTC](https://community.mp3tag.de/t/length-tab-minutes-and-seconds/63784/9 "2024-02-16T09:13:13Z")

</div>

Or, as there are so many ways to skin this cat:  
`$regexp(%_length%,^0,)`

---

<div class="post-metadata">

### Author: ![kwil](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/9de0a6/32.png) [@kwil](https://community.mp3tag.de/u/kwil)
#### Post date: [February 16, 2024, 7:49pm UTC](https://community.mp3tag.de/t/length-tab-minutes-and-seconds/63784/10 "2024-02-16T19:49:08Z")

</div>

Hi again...many thanks to all for taking time to reply. Much appreciated.

For 'ryerman': your suggestion worked perfectly, though with a small, rather than capital 'L' on 'Left' 🙂

So: '$trimleft(%\_length,0)

As for MP3 tracks of LESS than one minute...well, that would be extremely unlikely to happen for my music taste anyway.

Regarding absence of 'leading zero's looking 'odd':

I take the opposite view. Leading zeros for music tracks are just so unnecessary.  
Far cleaner to show **'4.06'** than **'04.06'** which in my view just looks 'untidy', no matter how techhnically accurate on a 24hr clock. 😀

That said, I've quite a few tracks that reach above '10'...as in 11.06, say.  
Now that **IS** a necessary leading number to give clarity on!

For 'ohrenkino': despite above, having a string to show tracks LESS than one minute is at least useful to know, so thanks again for that. Same with MotleyG...on 'IF' conditions...

Whatever your view, the central point to agree on is: **MP3 TAG** is a great resource for us all, as is the chance to share help and views on its usage.

Regards

---

<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: [March 17, 2024, 7:49pm UTC](https://community.mp3tag.de/t/length-tab-minutes-and-seconds/63784/11 "2024-03-17T19:49:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
