INTERACT FORUM

Please login or register.

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

Author Topic: Date Expression Help  (Read 1264 times)

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Date Expression Help
« on: June 07, 2015, 09:46:47 pm »

I'm trying to rewrite my photo handling expressions to make use of date parameters in the file structure:
  If [date] is 13/2/2014 I want the output file structure to be 2014/2014.02

How can I output the month to a number (ie February = 2)

I've tried =[date (month)]&DataType=[Integer]
and =[date (month)]&DataType=[Number]

But it always just outputs "February" or "March" etc.

I tend to just fumble around with expressions and through some combination of trial & error and luck I usually get there in the end :) but I can't figure this one out. Any help greatly appreciated!
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Date Expression Help
« Reply #1 on: June 07, 2015, 10:14:30 pm »

You almost certainly want to use the FormatDate() function.  If your example is literally true... that is, you want to take something like:

6/6/2015 and turn it into:  2015/2015.06

...then here's the expression to do it:

formatdate(%Y//%Y.%m)

Here are the full docs on it:

http://wiki.jriver.com/index.php/Expression_Language#FormatDate

Brian.
Logged

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Re: Date Expression Help
« Reply #2 on: June 09, 2015, 07:10:16 pm »

Thanks so much Brian - appreciate it :)
Logged
Pages: [1]   Go Up