Relative Date Keywords and Date Formatting


(M L Sanders) #1

Matrix Version: 5.3.3.0

Hi
I’m currently using the following globals + modifiers in a REST asset as part of the URL:
…&StartDate=%globals_date_relative_next_weekday_d^append:/%%globals_date_relative_next_weekday_m^append:/%%globals_date_relative_next_weekday_Y%&EndDate=

So that’s 3 x keywords, 2 of 'em with a modifier in order to get tomorrow’s date as ‘yy/mm/yyyy’. And it works: excellent.

I’d rather use a single '%globals_date_relative_next_weekday_d/m/Y% for conciseness.

Question 1: Is it possible to use forward slashes in this formatting?

Question 2: this keyword doesn’t appear to accept the PHP ‘day-based’ notation, as when I replace ‘next_weekday’ with ‘tomorrow’ everything breaks. Is this ‘correct’ behaviour?

Thanks as ever…


(Bart Banda) #2

Maybe try escaping the forwadslashes if they don’t work? Or alternatively use another character and then use the ^replace modifier to replace that other character with a forward slash?

%globals_date_relative_tomorrow% should work I would have thought? If it doesn’t, try %globals_date_relative_+1_day% ?


(Tbaatar) #3

Hi Bart,

The example keywords e.g _tomorrow and +1_day does not work with version 5.4.4.2. However %globals_date_relative_next_day_d-m-Y% works.

Since +1_day modifier does not seem to work how will you go about adding +2 or +3 days?

Many thanks.