Calculate MOD of current day

I''m trying to calculate the MOD of the current day.

  1. Set variable EvenDay to current day: %ICUDateTime%DD%

Then I tried:

  1. Calculate %Calculate%EvenDay MOD 2% => doesn't work
  2. Set a variable to calculation EvenDay MOD 2 => doesn't work

I'd appreciate any suggestions. Thank you

There's nothing obviously wrong with your "code", but check your date format. DD isn't correct (see list here), but %ICUDateTime% ignores the second D and gives you "day of year" -- today, Feb 4th, that's 35 and is odd.

If you only want the day of the month it is d or dd -- today, Feb 4th, that's 4 and is even.

If there's some other problem then post your macro and explain what "doesn't work" means.

1 Like