Get epoch new DateTime ZonedDateTime

I’m using this template rule I have found online for android alarmclock:

var Timer timerAlarm = null

rule "Alarm Clock"
when
    Item AlarmClock changed
then
    if (AlarmClock.state as Number == 0) {
        if (timerAlarm !== null) {
            timerAlarm.cancel
            timerAlarm = null
        }
        logInfo("alarm", "All alarms are cancelled")
    } else {
        var epoch = new DateTime((AlarmClock.state as Number).longValue)
        logInfo("alarm", "Scheduling alarm for " +  epoch.toString)

        if (timerAlarm !== null) {
            logInfo("alarm", "Reschedule alarm")
            timerAlarm.reschedule(epoch)
        } else {
            logInfo("alarm", "New Alarm")
            timerAlarm = createTimer(epoch,
                [ k |
                    // Turn on stuff, e.g. radio or light if somebody at home
                    if(gPresent.state == ON){
                    GF_MasterBedroom_Light.sendCommand(ON)
                    }
                    logInfo("alarm", "alarm is expired")
                ]
            )
            
            
        }
    }
end

I understand that I’m very on the edge of what expected here on this forum, but yet I have no idea how to “upgrade” my rules to OH 3. So I’m gonna leave it here just in case someone else’s willing to help. Cause frankly openHab’s image is it fit for hobbyists nad didn’t have too much trouble getting to know it and getting to love it, and I managed to make a couple of complex scripts, yes with this community forum’s help from time to time, but this new version change with all it’s deprecated libraries is leaving me in the dark and frankly I don’t know how to proceed other than leaving the platform… :frowning: (I got this answer for the second time)