Unparseable date exception when setting date-only DateTime variable

I wrote a rule to compute a date 10 days before Easter:

image

With these Hub Variables

But when I change "Date Easter", I get this exception:

(C7 using latest beta release as of today, but I don't think this has anything to do with the beta)

FWIW, I'm using these variables in a different rule to check the date range and activate a scene, so I suspect/hope adding the time to them won't matter.

image

And in fact, adding the time to the variable got rid of the exception, as expected, and then the rule worked fine.

image

I think the reason is that in order to apply an offset, the code needs to parse the existing date. If you remove the offset, there is no need to call the parse function.

1 Like

I'll look into it, but the source of the problem is adding minutes to a date (which has no time value to add minutes to). Clearly, RM should not have offered the "plus -14400 minutes" in this case.

3 Likes

I really only wanted to add days to the date, but it only offers minutes. 14400 minutes = 10 days.

Yeah, but there is no action to do that. Could be one, but there isn't.

And it's tricky, because
2025-11-02 0:00 + 1440 minutes = 2025-11-02 23:00
Not 2025-11-03 0:00, because that is the day DST ends for my timezone.

1 Like

I will put adding a days offset to a DateTime variable on the list of new features to look into. In the meantime, the fix will be not to throw a fatal error, but adding minutes to a date that has no time value makes no sense, and won't do anything.

2 Likes

Thank you!

As long as that doesn't break my workaround of using a 0:00 time!