Date format Rule doesn't working on OH2

First, How to use code fences

I’m surprised this worked in OH 1.x. lastUpdate doesn’t return a java.util.Date object, but using VSCode I see there is a toDate method.

Try

datf.format(HeatingTime.lastUpdate("mysql").toDate)