Date time transfer into item from the rule

In the rule I want increase a time about 4hours and then transfer into item (type DateTime). This item (time) I want use for start of any other rule in specific time:

I tired this :

val ZonedDateTime zdt = ZonedDateTime.now().plusHours(4)
postUpdate(myItem, zdt)

but it doesn’t work. myItem isn’t updated

See this topic:

zdt here is of type Java Time, so you have to use

val DateTimeType myDateTimeType = new DateTimeType(zdt) // conversion

This works:

val ZonedDateTime zdt = ZonedDateTime.now().plusHours(4)
val DateTimeType myDateTimeType = new DateTimeType(zdt)
postUpdate(myItem, myDateTimeType)