Time calculation from sun down time to end time to show seconds countdown for turn off lights and show time on dashboard

thanks for you reply after 2 hours of trying i found a solution with excuteable code ect

My flow

First (voer // get the current time date and time)

// Get the current date and time
var currentDate = new Date();
var currentTimeInSeconds = Math.round((currentDate.getHours() * 3600) + currentDate.getMinutes() * 60) + (currentDate.getSeconds());

// Set the result in a Homey variable of type number
setTagValue("Tijd Nu", {type: "number", title: "Tijd Nu"}, currentTimeInSeconds);

// Log the result (optional)
console.log("Current Time in Seconds: " + currentTimeInSeconds);

Second (Voer // Define the time in hours and minutes)

// Define the time in hours and minutes
var weekhours = 22;
var weekminutes = 30;
var weekendhours = 00;
var weekendminutes = 30;

// Calculate the total seconds
var totalSecondsweek = (weekhours * 3600) + (weekminutes * 60);
var totalSecondsweekend = (weekendhours * 3600) + (weekendminutes * 60);

setTagValue("Tijd Week", {type: "number", title: "Tijd Week"}, totalSecondsweek);
setTagValue("Tijd Weekend", {type: "number", title: "Tijd Weekend"}, totalSecondsweekend);

// Log the result (optional)
console.log("22:30 in seconds: " + totalSecondsweek);
console.log("00:30 in seconds: " + totalSecondsweekend);

ALERT this is the normal time (no winter time for dutch)
if you need this you have to add 3600 sec somewhere you want

i hope someone can use it good luck all

result
dashboard