INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Field Type - User Data  (Read 581 times)

Orac

  • Recent member
  • *
  • Posts: 34
Field Type - User Data
« on: January 04, 2024, 10:16:46 am »

Hi all,

I'm trying to add a user data field type which has a data type of "Date". The wiki says Date is "A complex type that is either date-only, or date and time"
There is no example of how this is formatted, can someone help with an example of the correct format please?
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2618
Re: Field Type - User Data
« Reply #1 on: January 04, 2024, 11:11:31 am »

The Date values are entered and displayed using your Windows regional settings. So if you're in US, today is "01/04/2024"; in Germany it might be "04.01.2024". Time is optional - you can enter "01/04/2024 16:23" or just "01/04/2024" (in effect, the 00:00:00 timestamp is not displayed).

Internally, the date is stored using the exact same date format as Excel, as the number of days since Dec 31 1899 (or as Excel puts it, January zeroth 1900 ::)), with the fractional part representing the time. You can play with this in Excel by entering a date/time and then formatting the cell as Number or General. You can display and use this internal value in MC's Expression Language with [fieldName, 0]. There are expression functions to convert between the internal and display formats, to parse dates, do date math, etc. You can use an expression to display Date fields in whatever format you like.

Examples (US format):
01/04/2024 = 45295
01/04/2024 18:10:00 = 45295.7569444444
45678.123 = 01/21/2025 02:57:07

You don't need to concern yourself with any of this if you just want to use dates in your local format. Just enter them as you're used to, and that's how you'll see them.
Logged

Orac

  • Recent member
  • *
  • Posts: 34
Re: Field Type - User Data
« Reply #2 on: January 04, 2024, 12:39:42 pm »

Thanks zybex, very helpful.
Logged

Orac

  • Recent member
  • *
  • Posts: 34
Re: Field Type - User Data
« Reply #3 on: January 05, 2024, 04:34:54 am »

I've tried tinkering about with date formats but can't get them to work with what I'm trying to do, let me explain ...

I have created a custom tag called RIPDATE which I fill in with the date I rip my vinyl or CD  to FLAC. I use MP3Tag for this purpose. If I do a tag dump, I can see the RIPDATE field in the VorbisComment Block for FLAC and the ID3.2.3 Tag for wav files.

I would like to be able to sort on the RIPDATE field but when I select 'Custom' from the 'Sort By' menu and select 'Add' the RIPDATE custom field does not appear in the dropdown list, it only seems to contain the standard library fields. Is this possible or am I missing something?

Alternatively, is there some method I could use to copy or map the RIPDATE custom tag across to one of MC's standard library fields so it would happen automatically when I import a new set of files? I'm thinking 'Date Recorded' would be a good choice since that does appear in the sort order drop down.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2618
Re: Field Type - User Data
« Reply #4 on: January 05, 2024, 07:48:29 am »

It's not enough to add RIPDATE tag to the id3 tag, you also need to create the field with the exact same name in MC and import the files so that the field value is read (or do Library Tools -> Update Library from tags). Only fields created in MC can be used for sorting/display. When creating the field, make sure to check the "save in file tags" option so that MC writes back the Date value to the ID3 tag when you change it in MC.

If you write the RIPDATE tag value using a 3rd party tool, it will likely write it as a String or some other format (not this Excel-based numbering). Either you create a String field in MC to match it (but then it may not sort correctly as a Date), or create it as Date in MC and use just MC to populate the value - ie, do not use any other tagging tool to write it.
Logged

Orac

  • Recent member
  • *
  • Posts: 34
Re: Field Type - User Data
« Reply #5 on: January 05, 2024, 09:20:39 am »

Thanks for that useful info zybex.

Going forward, I think I will continue to use MP3Tag for the main fields, but when I then import the files I will use MC to update the 'Date Recorded' field which I can then use for sorting.
Not a big deal, just an extra step for new rips. It's the 676 existing vinyl albums I've ripped that might take some time to update!
Logged

markf2748

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 818
Re: Field Type - User Data
« Reply #6 on: January 05, 2024, 01:14:56 pm »

Logged

Orac

  • Recent member
  • *
  • Posts: 34
Re: Field Type - User Data
« Reply #7 on: January 05, 2024, 01:47:11 pm »

Logged
Pages: [1]   Go Up