Help - Search - Members - Calendar
Full Version: Date format conversion
Mp3tag Forums > Mp3tag - International > Support
Solance
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.gif
ohrenkino
ZITAT(Solance @ Apr 21 2017, 12:18) *
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.gif

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
DetlevD
QUOTE (Solance @ Apr 21 2017, 12:18) *
Looking for a little help. ...

Do have a look into ... e. g. ...
https://forums.mp3tag.de/index.php?showtopic=19540
... and follow the ISO 8601 date time standard format,...
especially for the tagfield RELEASETIME.

DD.20170421.1336.CEST
Solance
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?
ohrenkino
ZITAT(Solance @ Apr 21 2017, 14:43) *
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?

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%.
Solance
QUOTE (ohrenkino @ Apr 21 2017, 15:51) *
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! laugh.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.