DateTime error (Daylight Savings Time)?

Hi!

I use BetterLogic (great app btw) to get $timenow$. It’s correct in Swedish time adjusted to DST.
I try <const d = new Date();> in Homey Script. It returns 1 hour wrong. I run that code in my browser (W3Schools Tryit Editor) and it returns correctly.

How can I get Homey to return the correct time? This is vital for me.

Many thanks!

What does the humanTime say here?:
https://tools.developer.homey.app/tools/system

A way to force the right timezone is to temporary move your location to another timezone and move it back after a while
( …More > Settings > Location)

Or it is the issue Homey uses UTC everywhere.
Script (partly in dutch):

2 Likes

Hi!

dateHuman Tuesday 21st March 2023 12:54:00
dateDst false

Both are correct “there” but not from the Homey Script console, where I need it. Weird! I will brush off my dutch now and read your thread! :wink:

Many thanks!

1 Like

Thank you, this worked!!!

3 Likes