# Date format conversion

**URL:** https://community.mp3tag.de/t/date-format-conversion/18910
**Category:** Support
**Created:** [April 21, 2017, 8:18am UTC](https://community.mp3tag.de/t/date-format-conversion/18910 "2017-04-21T08:18:11Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![Solance](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/5fc32e/32.png) [@Solance](https://community.mp3tag.de/u/Solance)
#### Post date: [April 21, 2017, 8:18am UTC](https://community.mp3tag.de/t/date-format-conversion/18910/1 "2017-04-21T08:18:11Z")

</div>

Looking for a little help.  
Need to take date data from (YEAR) field in (YYYY-MM-DDTHH:MM:SS) format and move it to (RELEASETIME) field in (DD-MM-YYYY) format.  
Something like "2017-04-16T07:00:00Z" to "16-04-2017"  
Any advice? ![:huh:](https://community.mp3tag.de/uploads/default/original/1X/f15ee73c0fd9ec3b0db7481f0558638f8ee224ce.gif ":huh:")

---

<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: [April 21, 2017, 9:06am UTC](https://community.mp3tag.de/t/date-format-conversion/18910/2 "2017-04-21T09:06:38Z")

</div>

The YEAR field looks a lot like the proper format for field RELEASETIME. I would not change it at all.  
RELEASETIME has both: the day and the hour. And it needs it in the sequence of year-month-day.

So, if you change the order then it might be that you get suprising results esp. when sorting as you then get all first days of all months first, then the second and so on.l

---

<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: [April 21, 2017, 9:36am UTC](https://community.mp3tag.de/t/date-format-conversion/18910/3 "2017-04-21T09:36:36Z")

</div>

> [@Solance](#):
>
> Looking for a little help. ...

Do have a look into ... e. g. ...  
[/t/16556/1](https://community.mp3tag.de/t/16556/1)  
... and follow the ISO 8601 date time standard format,...  
especially for the tagfield RELEASETIME.

DD.20170421.1336.CEST

---

<div class="post-metadata">

### Author: ![Solance](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/5fc32e/32.png) [@Solance](https://community.mp3tag.de/u/Solance)
#### Post date: [April 21, 2017, 10:43am UTC](https://community.mp3tag.de/t/date-format-conversion/18910/4 "2017-04-21T10:43:11Z")

</div>

ok so this (DD-MM-YYYY) format is "broken" for (RELEASETIME) field.  
but it always could be added in (COMMENT) or somewhere else, so is there a way to convert date somehow?

---

<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: [April 21, 2017, 10:51am UTC](https://community.mp3tag.de/t/date-format-conversion/18910/5 "2017-04-21T10:51:45Z")

</div>

Create an action of the type "Format value" for COMMENT or somewhere else.  
Format string: $regexp('2017-04-16T07:00:00Z',(\d+)-(\d+)-(\d+)T.\*,$3-$2-$1)

Instead of the '2017-04-16T07:00:00Z' part of the expression set the source field name, e.g. %year%.

---

<div class="post-metadata">

### Author: ![Solance](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/5fc32e/32.png) [@Solance](https://community.mp3tag.de/u/Solance)
#### Post date: [April 21, 2017, 12:08pm UTC](https://community.mp3tag.de/t/date-format-conversion/18910/6 "2017-04-21T12:08:12Z")

</div>

> [@ohrenkino](#):
>
> Create an action of the type "Format value" for COMMENT or somewhere else.  
> Format string: $regexp('2017-04-16T07:00:00Z',(\d+)-(\d+)-(\d+)T.\*,$3-$2-$1)
> 
> Instead of the '2017-04-16T07:00:00Z' part of the expression set the source field name, e.g. %year%.

perfect, exactly what I needed, problem solved.  
thanks a lot! 😆

---

<div class="post-metadata">

### Author: ![owlcatz](https://community.mp3tag.de/user_avatar/community.mp3tag.de/owlcatz/32/9883_2.png) [@owlcatz](https://community.mp3tag.de/u/owlcatz)
#### Post date: [October 19, 2021, 12:20pm UTC](https://community.mp3tag.de/t/date-format-conversion/18910/7 "2021-10-19T12:20:21Z")

</div>

Here's a different variation I'm trying to solve. How do I change format of type:

1/13/2001 -\> 2001-01-13  
3/2/1998 -\> 1998-03-02

I feel like I'm close, but no cigar yet...

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: [October 19, 2021, 12:22pm UTC](https://community.mp3tag.de/t/date-format-conversion/18910/8 "2021-10-19T12:22:11Z")

</div>

Could you show us what you have tried so far - it is much easier to build on that.

---

<div class="post-metadata">

### Author: ![owlcatz](https://community.mp3tag.de/user_avatar/community.mp3tag.de/owlcatz/32/9883_2.png) [@owlcatz](https://community.mp3tag.de/u/owlcatz)
#### Post date: [October 19, 2021, 12:26pm UTC](https://community.mp3tag.de/t/date-format-conversion/18910/9 "2021-10-19T12:26:11Z")

</div>

Well To be honest, no so far really - Just testing diff variations of the above but without dashes in the input field - something like :

`$regexp(%date%',(\d+)\/(\d+)\/(\d+),$3-$2-$1) ,`

I'm also using an online regex builder but in all honesty, trying to figure this out is very painful to my brain, I've always sucked at regex... ☹ Sorry/Thanks!

Edit - I think the tricky part is going to be adding the leading zeroes where none exist, but I'm not even that far yet. 😑

---

<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 19, 2021, 12:32pm UTC](https://community.mp3tag.de/t/date-format-conversion/18910/10 "2021-10-19T12:32:20Z")

</div>

I think in

> [@owlcatz](#):
>
> $3-$2-$1)

the order is the wrong one - it should be  
`$3-$1-$2`  
to turn 1/13/2001 into 2001-01-13

In a second step you could add the zero like:  
`$regexp($regexp('1/13/2001',(\d+)/(\d+)/(\d+),$3-$1-$2),(\d\d\d\d)-(\d)-(\d\d),$1-0$2-$3)`

---

<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: [October 19, 2021, 12:57pm UTC](https://community.mp3tag.de/t/date-format-conversion/18910/11 "2021-10-19T12:57:04Z")

</div>

> [@owlcatz](#):
>
> 3/2/1998

There are several ways to get the leading zeroes to your date.  
Assuming, your date 3/2/1998 comes from the tag DATE:  
`$regexp(%DATE%,'\b(\d)(?=\/)',0$1)`

---

<div class="post-metadata">

### Author: ![owlcatz](https://community.mp3tag.de/user_avatar/community.mp3tag.de/owlcatz/32/9883_2.png) [@owlcatz](https://community.mp3tag.de/u/owlcatz)
#### Post date: [October 19, 2021, 12:57pm UTC](https://community.mp3tag.de/t/date-format-conversion/18910/12 "2021-10-19T12:57:55Z")

</div>

Thanks man, that's much closer. I think I can get there from here, but if not I'll post back later.

Love this community - where else can you post on a 5 year old thread and get an answer in minutes?

You guys rock, thanks @ohrenkino & @LyricsLover

---

<div class="post-metadata">

### Author: ![owlcatz](https://community.mp3tag.de/user_avatar/community.mp3tag.de/owlcatz/32/9883_2.png) [@owlcatz](https://community.mp3tag.de/u/owlcatz)
#### Post date: [November 12, 2021, 5:15pm UTC](https://community.mp3tag.de/t/date-format-conversion/18910/13 "2021-11-12T17:15:57Z")

</div>

Thanks all - Here is how to get a date formatted like 1/4/2011 to 2011-01-04 from YEAR, reformat it, and copy it to RELEASETIME

[https://i.imgur.com/NOWnKOah.jpg](https://i.imgur.com/NOWnKOah.jpg)

---

<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: [November 12, 2021, 6:23pm UTC](https://community.mp3tag.de/t/date-format-conversion/18910/14 "2021-11-12T18:23:46Z")

</div>

Your link to the external picture hoster doesn't work (anymore).

You can copy & paste such print screens directly in your answer 😉

---

<div class="post-metadata">

### Author: ![Jimmy\_Neutron](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@Jimmy\_Neutron](https://community.mp3tag.de/u/Jimmy_Neutron)
#### Post date: [November 13, 2021, 2:31am UTC](https://community.mp3tag.de/t/date-format-conversion/18910/15 "2021-11-13T02:31:19Z")

</div>

> [@LyricsLover](#):
>
> Your link to the external picture hoster doesn't work (anymore).

I got it OK. Here is the image pasted:

 ![NOWnKOah](https://community.mp3tag.de/uploads/default/original/2X/e/e91442000739e2461a0049ae7fa8c46dd0c81a9e.jpeg)

---

<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: [November 13, 2021, 11:03am UTC](https://community.mp3tag.de/t/date-format-conversion/18910/16 "2021-11-13T11:03:17Z")

</div>

If you don't need `WORK` (assuming your instruction `%null%` in the 5th entry delete the content), you can strip the 2nd and 5th entry completely.  
Replace `%work%` in the 3rd command with `%releasetime%`

---

<div class="post-metadata">

### Author: ![owlcatz](https://community.mp3tag.de/user_avatar/community.mp3tag.de/owlcatz/32/9883_2.png) [@owlcatz](https://community.mp3tag.de/u/owlcatz)
#### Post date: [November 13, 2021, 12:21pm UTC](https://community.mp3tag.de/t/date-format-conversion/18910/17 "2021-11-13T12:21:15Z")

</div>

Ah thanks - I hadn't really cleaned it up yet, good catch, thanks! 🙂

---

<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: [January 19, 2025, 3:40pm UTC](https://community.mp3tag.de/t/date-format-conversion/18910/18 "2025-01-19T15:40:06Z")

</div>

3 posts were split to a new topic: [Converting date format in %\_date% to YYYY-MM-DD in Export](https://community.mp3tag.de/t/converting-date-format-in-date-to-yyyy-mm-dd-in-export/67201)

---

<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 18, 2025, 4:39pm UTC](https://community.mp3tag.de/t/date-format-conversion/18910/20 "2025-02-18T16:39:23Z")

</div>

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