[SOLVED] Epoch timestamp to right date Time

As hilbrand says, with avoiding Joda datetime -

demo in a rule

val EpochString = "1594620000000"
// epoch carries no timezone info at all
// and so is usually assumed to be GMT aka UTC

// conventional conversion 
val MyDateTimeTypeFromEpoch = new DateTimeType(EpochString)
logInfo("test", "raw dttype " + MyDateTimeTypeFromEpoch.toString)

// post to Item
testDate.postUpdate(new DateTimeType(EpochString))
Thread::sleep(500)
logInfo("test", "item " + testDate.state.toString)

result

2020-07-14 13:34:44.684 [INFO ] [.eclipse.smarthome.model.script.test] - raw dttype 2020-07-13T06:00:00.000+0000
2020-07-14 13:34:45.190 [INFO ] [.eclipse.smarthome.model.script.test] - item 2020-07-13T06:00:00.000+0000

I think that’s what you are after?