Can local variables include %time% and %date% values?

Can local variables include %time% and %date% values? That is, do the values get expanded?

Example: vVariable is a string, with text 'This is a test on %date% at %time%'. At noon on Jan. 1, 2025, would this variable be spoken or logged as "This is a test on January 1, 2025 at 12:00pm"?

Yes.

1 Like

Good to know that a SET command will work, BUT I'd like to set the default values for a local variable in the LV table AND be able to use %time% and %date% values (to be resolved when the rule is run).

I use such "variables" more like easily settable constants that allow me to easily see and change all of the variables within a Rule.

You can't put %time% or %date% into a variable as non-evaluated. They are evaluated when the rule is run and during rule setup. If you look at my example above, myvar had a different value before the rule ran, but the string displayed for the action would still show before it ran what it would look like (at least as of the time of editing the rule):

Notice that myVar hasn't been set to a different value yet. You can't embed %time% in a variable without it being evaluated, and if you were to put it in using the UI, it won't be evaluated at all.

1 Like

Thank you for the detailed explanation and the confirmation that system variables are not evaluated when used as part of a string in the LV table!