Dayofweek from DateTime-Item

Hi,
is it possible to get the “day of week” from a existing DateTime item?
i’ve looked around but i could only find the dayofweek from “today” with
now.getDayOfWeek()

i’ve tried DateTimeItem.getDayOfWeek() but i get the following warning in Visual Studio:

The method getDayOfWeek() is undefined for the type DateTimeItem

and this error while executing the rule:

‘getDayOfWeek’ is not a member of ‘org.eclipse.smarthome.core.library.items.DateTimeItem’

any help is appreciated :slight_smile:

Convert the DateTime Item’s state to a Joda DateTime or a ZonedDateTime. See https://www.openhab.org/docs/configuration/rules-dsl.html#datetime-item

1 Like