Get the month to a system variable

I want to use the month name only in one of my sonos TTS. I am trying to set a system variable to the current month.

Like this:

%date% has the format 26-Feb-2021. So token 1 of that, delimited by "-", is Feb. Also note that a global variable could be used instead of local, if the value is needed in a different rule.

Now if you want February instead of Feb, you'd have to build a big list of conditionals to test for each month abbreviation from the above to replace it with the full month word.

IF(month = 'Jan') Set month to 'January'
IF(month = 'Feb') Set month to 'February'

etc.

2 Likes

Thank you that is perfect!!!!

Done and done.

I have just tried this and the it hasn't worked as expected. There appears to be extra quotes added into the action. Wondering if this is an RM5.x bug @bravenel?

That's just UI display to show what string is being used.

Hmm ok but it definitely doesn't work - can you reproduce?

I have found a workaround but it is not pretty, given that it should be possible in one line

I understand. As it stands, the rule is not expanding %date% in the string input for the token operator. See below. I will look into it doing that expansion. Don't be fooled by the text in black, as that is showing you a hidden value.

Here is how you want it to work. This will be in the next release:

2 Likes

Love your work, thanks. I never cease to be amazed at how responsive you guys are from a support perspective. It is fantastic.

1 Like