# Padding digits with converted dates

**URL:** https://community.mp3tag.de/t/padding-digits-with-converted-dates/19514
**Category:** Support
**Created:** [November 7, 2017, 6:22pm UTC](https://community.mp3tag.de/t/padding-digits-with-converted-dates/19514 "2017-11-07T18:22:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![anonamoth](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/838e76/32.png) [@anonamoth](https://community.mp3tag.de/u/anonamoth)
#### Post date: [November 7, 2017, 6:22pm UTC](https://community.mp3tag.de/t/padding-digits-with-converted-dates/19514/1 "2017-11-07T18:22:50Z")

</div>

i want to convert dates from format M/D/YYYY to YYYY-MM-DD:  
ex. 11/7/2017 to 2017-11-07

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

the problem is that if the original date contains a single digit for month or day, i get a single digit in the converted date. (ex. 11/7/2017 becomes 2017-11-7 not 2017-11-07)

how do i pad the month and day to always display 2 digits?

i tried: $regexp(%releasetime%,(\d+)/(\d+)/(\d+),$3-$1-$num($2,2))

but this does not work, returns: 2017-11-00

any help with this would be appreciated, 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: [November 7, 2017, 6:50pm UTC](https://community.mp3tag.de/t/padding-digits-with-converted-dates/19514/2 "2017-11-07T18:50:00Z")

</div>

You could run a second action in that action group with this expression:  
$regexp(%releasetime%,(\d+)-(\d)$,$1-0$2)  
It leaves '2017-11-07' as it is but transforms  
'2017-11-7' into '2017-11-07'

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [November 8, 2017, 6:00am UTC](https://community.mp3tag.de/t/padding-digits-with-converted-dates/19514/3 "2017-11-08T06:00:03Z")

</div>

> [@anonymoth](#):
>
> i want to convert dates from format M/D/YYYY to YYYY-MM-DD ...

Read there ...  
[/t/9074/1](https://community.mp3tag.de/t/9074/1)

DD.20171108.0800.CET

---

<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:27pm UTC](https://community.mp3tag.de/t/padding-digits-with-converted-dates/19514/4 "2026-02-09T12:27:05Z")

</div>


