Menu

#185 dates not being written correctly

3.6.1
closed
nobody
None
1
2018-12-23
2018-10-18
Tom
No

Using 3.6.1 (linux). Selected an mp3 file, entered 2018-10-20 for the date field in tag 2, and saved changes. Mediainfo on the file displays:

Recorded date : 2018-20-10

Discussion

  • Urs Fleisch

    Urs Fleisch - 2018-10-18

    Could it be that Mediainfo is wrong?

    I created two files id3v23.mp3 having an ID3v2.3.0 tag with date 2018-10-20 and id3v24.mp3 having the same with an ID3v2.4.0 tag.

    $ xxd id3v23.mp3 | head -n3
    00000000: 4944 3303 0000 0000 081e 5459 4552 0000  ID3.......TYER..
    00000010: 0005 0000 0032 3031 3854 4441 5400 0000  .....2018TDAT...
    00000020: 0500 0000 3230 3130 0000 0000 0000 0000  ....2010........
    $ mediainfo id3v23.mp3 | grep Recorded
    Recorded date                            : 2018-20-10
    $ xxd id3v24.mp3 | head -n2
    00000000: 4944 3304 0000 0000 080f 5444 5243 0000  ID3.......TDRC..
    00000010: 000b 0000 0032 3031 382d 3130 2d32 3000  .....2018-10-20.
    $ mediainfo id3v24.mp3 | grep Recorded
    Recorded date                            : UTC 2018-10- 0
    

    Looking at the specifications, I would say that the frames written by Kid3 are correct:

    id3v2.3.0.txt

      TYER
       The 'Year' frame is a numeric string with a year of the recording.
       This frames is always four characters long (until the year 10000).
      TDAT
       The 'Date' frame is a numeric string in the DDMM format containing
       the date for the recording. This field is always four characters
       long.
    

    id3v2.4.0-frames.txt

      TDRC
       The 'Recording time' frame contains a timestamp describing when the
       audio was recorded. Timestamp format is described in the ID3v2
       structure document [ID3v2-strct].
    

    id3v2.4.0-structure.txt

       The timestamp fields are based on a subset of ISO 8601. When being as
       precise as possible the format of a time string is
       yyyy-MM-ddTHH:mm:ss (year, "-", month, "-", day, "T", hour (out of
       24), ":", minutes, ":", seconds), but the precision may be reduced by
       removing as many time indicators as wanted. Hence valid timestamps
       are
       yyyy, yyyy-MM, yyyy-MM-dd, yyyy-MM-ddTHH, yyyy-MM-ddTHH:mm and
       yyyy-MM-ddTHH:mm:ss. All time stamps are UTC. For durations, use
       the slash character as described in 8601, and for multiple non-
       contiguous dates, use multiple strings, if allowed by the frame
       definition.
    
     
  • Tom

    Tom - 2018-10-20

    Oops. I guess I wasn't aware of the differences between id3v2.3.0 and id3v2.4.0 tags - and of course, kid3 is set up (maybe defaults to) id3v2.3.0. Have changed that (and will go back to make sure that every tag in my collection is 2.4), and will also file a bug with mediainfo.

     
  • Tom

    Tom - 2018-10-20

    One more question (just while talking about "dates"). Is there any way of getting the "Date Modified" column in the list of songs to display as ISO 8601? I detest DD/MM more than you would believe, and in fact have patched (and recompiled) my glibc in an attempt to get rid of this travesty as it relates to my locale, but it seems that kid3 (and some other applications) simply look up my locale, and use the format normally associated with my locale, rather than what I have compiled.

    This is part of the patch I use in localedata/locales/xx:

    +% date formats following ISO 8601-1988
    +d_t_fmt "<u0025><u0059><u002d><u0025><u006d><u002d><u0025><u0064><u0054><u0025><u0054><u0020><u0025><u005a>"
    +d_fmt "<u0025><u0059><u002d><u0025><u006d><u002d><u0025><u0064>"
    +t_fmt "<u0025><u0054>"
    +am_pm "";""
    +t_fmt_ampm "<u0025><u0048><u003a><u0025><u004d><u003a><u0025><u0053>"</u0053></u0025></u003a></u004d></u0025></u003a></u0048></u0025></u0054></u0025></u0064></u0025></u002d></u006d></u0025></u002d></u0059></u0025></u005a></u0025></u0020></u0054></u0025></u0054></u0064></u0025></u002d></u006d></u0025></u002d></u0059></u0025>

    Any insight you could give me (other than changing locales) to get "Date Modified" as YYYY-MM-DD would be appreciated.

     
  • Urs Fleisch

    Urs Fleisch - 2018-10-20

    I want to have ISO date format too, but I did not go so far as to patch glibc.
    I have set Canada - Canadian English (en_CA) for the Time category in Regional Settings/Formats of KDE's System Settings. The other categories can be left as they are. So if you do not care changing locales, that could be worth trying. Your desktop environment probably has similar settings which will set LC_TIME=en_CA.UTF-8.

     
  • Jerome Martinez

    Jerome Martinez - 2018-10-20

    Could it be that Mediainfo is wrong?

    I (developer of MediaInfo) confirm that MediaInfo is wrong. Will fix soon.

     
  • Urs Fleisch

    Urs Fleisch - 2018-12-23
    • status: open --> closed