News:

  • September 23, 2026, 01:36:10 AM

Login with username, password and session length

Author Topic: Daylight Savings Time Control Logic  (Read 5992 times)

Bolt

  • Hero Member
  • *****
  • Posts: 598
Daylight Savings Time Control Logic
« on: November 28, 2020, 01:50:36 PM »
I have the attached logic (in $tTopOfScan) to toggle between daylight saving and daylight wasting time.  Also, for some possibly clunky logic I use elsewhere to store $UTC timestamps in UDT's, I calculate the offset.
However, the recent time change did not trigger the re-calculation of the Offset variable.  If I were to move the MATH rung to before the SET and RST rungs, would it have triggered correctly?

On a related note, how do you convert $UTC to UDT's and account for the correct time zone in the layout?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Daylight Savings Time Control Logic
« Reply #1 on: November 28, 2020, 02:46:06 PM »
Roughly this: $LocalTime = $UTC + ($TimeZone*60) + ($SummerTime*3600)

"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO