“Text of” is going to give you a String. You can’t do math with a String. But you should be able to create a new variable and set that date block to the variable and then use the variable in the math block.
I think that’s done through the “get contextual attribute” block.
You can change that by defining a .persist file and only list those Items you want to have persisted.
That wouldn’t work even in code as written and I’m pretty sure addition and substraction of ZonedDateTimes is not supported in Blockly. In Rules DSL et. al. you would use the Duration class.
var diff = java.time.Duration.between(now, midnight)
Doing math like that has never been supported with ZonedDateTimes.
That’s going to be the case for any and all things in openHAB or any other such system as openHAB. OH provides a decent default behavior which works for most users in most cases. However, once you need to override the default it’s going to be complex because the overrides need to support everyone’s use cases.