Now.getdayofweek & time zones?


I have a rule that runs at 5 minutes after midnight and uses now.getdayofweek. It returns the prior day versus running it at 8am.

My timezone is set for America/New_York in raspi-config and Eastern/US in paper-UI.

[09:25:52] openhabian@pi-openhab:~$ sudo timedatectl
[sudo] password for openhabian:
               Local time: Mon 2020-03-16 09:26:01 EDT
           Universal time: Mon 2020-03-16 13:26:01 UTC
                 RTC time: n/a
                Time zone: America/New_York (EDT, -0400)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

time zone info is commented out in /etc/default/openhab2

What am I missing?

I’d guess this is the problem.

I suppose… getHourOfDay returns the proper result.

If it needs to be uncommented, shouldn’t raspi-config or openhabian-config do that automatically?

I just don’t like adding new variables to my setup without knowing for sure…

On my openhabian did so:
openhabian-config --> System Setting --> Set System Timezone
and chose not “+4” but “-4”. Now shows the correct time

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.