The constructor DateTimeType(Calendar) is deprecated

Hi can anyone help me with this:

I have following rule:

rule "Boot"
when
	System started
then
    BootTime.sendCommand(new DateTimeType(now.toGregorianCalendar))
end

I get the message “The constructor DateTimeType(Calendar) is deprecated” when the rule is evaluated so I changed it to:

rule "Boot"
when
	System started
then
    BootTime.sendCommand(new DateTimeType(ZonedDateTime.now)) 
end

Unfortunately it does not fix the issue it still gives the same warning althou it should now use the constructor ‘DateTimeType(ZonedDateTime)’

Thanks
Alex

Can’t give you straight answer but this was discussed earlier on this forum. Please use search with “DateTimeType”.

I only found this:

MyDateTimeItem.postUpdate(now.toString)

but this this relies on parsing a string representation of the date. I cannot believe that this is more precise than using any explicit conversion.

Saw this? DateTimeType is deprecated