Okay, after updating to OH3, both methods do not work any more.
I have tried many variants, also from https://community.openhab.org/t/datetime-conversion-openhab-3-x/107197, without success.
I get errors like "Could not invoke method: org.openhab.core.model.script.actions.BusEvent.postUpdate(org.openhab.core.items.Item,java.lang.Number) on instance: null in home "
Any idea how to fix it?