INTERACT FORUM

Please login or register.

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

Author Topic: Expression to Calculate: Days since Imported (for playlist)  (Read 3024 times)

Ferdi

  • World Citizen
  • ***
  • Posts: 195
Expression to Calculate: Days since Imported (for playlist)
« on: April 10, 2016, 09:47:55 pm »

I'd like to have a playlist that shows me music that I have imported during the last x number of days.

An expression could be "today minus date imported greater than x",  and i found out that these components could be used:
  • now() gives me the current date in numeric value
  • ConvertDate([Date Imported]) converts the import date into numeric value

I fail to turn that into a correct expression though, don't know how to subtract, which I thought would be the most simple part of this!

Appreciate any help. cheers.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Expression to Calculate: Days since Imported (for playlist)
« Reply #1 on: April 10, 2016, 09:58:59 pm »

if you use convertdate() it will turn a readable date into the computerized big number, but then you should be able to do a simple math

math(convertdate(now())-convertdate([date(imported)]))

or something close to that, no chance to test ATM
Logged

Ferdi

  • World Citizen
  • ***
  • Posts: 195
Re: Expression to Calculate: Days since Imported (for playlist)
« Reply #2 on: April 10, 2016, 10:25:06 pm »

Thanks for the super quick reply!
I needed to slightly modify to: Math(now() - ConvertDate([Date Imported])). 
When using this as a new field and displaying this field, I noticed that the value is updated almost constantly. Reason is that 'now' goes by seconds...

So next I tried to format that output into 'days', and actually saw that for the for the formula formatdate, this example is given: FormatDate([Date Imported, 0], elapsed) .
Pretty nifty. I'll start playing around with this, as it's not perfect either when used in a playlist, since the values are now hard to compare.

Anyway, I now got two ideas that I can play with, will keep me busy for a while I think :)
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Expression to Calculate: Days since Imported (for playlist)
« Reply #3 on: April 10, 2016, 10:47:25 pm »

in a smartlist you can also use

[date (imported)]=<Xd

as a search string (X is the number)
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9165
Re: Expression to Calculate: Days since Imported (for playlist)
« Reply #4 on: April 11, 2016, 12:14:46 am »

Might be something here you could find useful too..

http://yabb.jriver.com/interact/index.php?topic=102319.msg709847#msg709847

Ferdi

  • World Citizen
  • ***
  • Posts: 195
Re: Expression to Calculate: Days since Imported (for playlist)
« Reply #5 on: April 12, 2016, 12:33:14 am »

Thanks - that's brilliant information on there. Looking forward to free time on the weekend :)
Logged
Pages: [1]   Go Up