Author Topic: truncating Date Modified so it can be used in a sort  (Read 540 times)

jmead

  • Newbie
  • *
  • Posts: 2
I use MusicBee to prepare my radio show. Since the show is partially based on music submitted by labels or promoters, I like to have Music Bee show me tracks by descending Modified Date.

Here's my issue: I'd like tracks to appear as if sorted as follows:

Modified Date (desc) / Album / Track#

Tracks usually do appear by date/Album, but the track# are usually not in ascending order. I suspect this is because if/when I edit the tracks, they are not all saved at exactly the same moment. So when the tracks are displayed, they're out of order because if track 1 was saved before track 2, then track 2 will appear first because it's a descending time list by a few milliseconds. (Note that this means that really the secondary sort--Album--is also irrelevant.)

So my question is: is there a way to truncate the modified date so that (milli)seconds are not taken into account? Then my custom sort would work (most of the time).

Thanks,
Jonathan

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
Hi, welcome to the forum!

Yes, you could use a virtual tag for this. Virtual tag functions include $Date(), which can be used to format a date value for your needs.

You can find more info here:
https://musicbee.fandom.com/wiki/Virtual_Tags
https://musicbee.fandom.com/wiki/Functions
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)


Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2450
In case it wasn't obvious, it would be over-complicating things to create a virtual tag that 'truncates' the (milli)seconds from the modified date.
Just create a tag that turns the date into a numeric value which can always be sorted chronologically.

i.e.
Code
$Date(<Date Modified>,yyyyMMdd)
Bee excellent to each other...