Timeconversion: Astro Binding (DateTime) to Date() javascript object

No. Every time you are interacting with OH in rules, no matter what the rules language, you are using Java Objects. Items, Item states, Actions like createTimer, and everything else are all Java Objects. That linked tutorial shows how to use the Java ZonedDateTime and openHAB DateTimeType classes to do date time operations. Since it’s Java, no matter what language you are using will be largely the same.

You could convert a ZonedDateTime (or more likely a LocalDateTime) to a JavaScript DateTime Object, but then you’d have to convert it back to Java to use it in any sort of interaction with OH. Since the whole point of rules is to interact with OH, why bother? It’s mostly just creating more work and complexity for you. Just use the Java stuff.

No, it stores a DateTimeType Object which is a Java class.

So use ZonedDateTime like demonstrated in the link.

ZonedDateTime.now().isBefore(items["LokaleSonnendaten_Set_Start"].getZonedDateTime())

Unfortunately though you’ll have to “import” ZonedDateTime to do this.

var ZonedDateTime = Java.type("java.time.ZonedDateTime");

Or you can create a new DateTimeType which will be initialized to now.

new DateTimeType.getZonedDateTime().isBefore(items["LokaleSonnendaten_Set_Start"].getZonedDateTime())

Notice how I don’t mess with the itemRegistry. There is no point in doing that here either. There is a dict of all the Item’s state injected into the rule for your use.