Printable Version of Topic

Click here to view this topic in its original format

Mp3tag Forums _ Support _ Date format conversion

Posted by: Solance Apr 21 2017, 11: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

Posted by: ohrenkino Apr 21 2017, 12:06

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

Posted by: DetlevD Apr 21 2017, 12:36

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

Posted by: Solance Apr 21 2017, 13: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?

Posted by: ohrenkino Apr 21 2017, 13:51

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%.

Posted by: Solance Apr 21 2017, 15:08

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

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)