mendhak / waveshare-epaper-display

At-a-glance dashboard for Raspberry Pi with a Waveshare ePaper 7.5 Inch HAT. Date/Time, Weather, Alerts, Google/Outlook Calendar
https://code.mendhak.com/raspberrypi-epaper-dashboard/
449 stars 66 forks source link

Event start and end time are not good #26

Closed DominicBoisvert closed 2 years ago

DominicBoisvert commented 2 years ago

Hi @mendhak,

Thanks for this project. It's not only fun, but very useful.

Here is my problem. When I run "outlook_util.py" four hours are added to the start and end time of the events.

The clock of the Pi Zero is ok, and the time of events in the Outlook Calendar are ok.

Thanks.

mendhak commented 2 years ago

What about the display on the Waveshare display itself, is that showing up fine?

The times you see from the outlook_util.py are in UTC (that's what the MS APIs return), so I assume you're living in a -4 timezone. The calendar entries should get displayed in the Pi's timezone.

You can see your current timezone using timedatectl

$ timedatectl
               Local time: Fri 2021-10-29 19:14:55 BST
           Universal time: Fri 2021-10-29 18:14:55 UTC
                 RTC time: n/a
                Time zone: Europe/London (BST, +0100)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
DominicBoisvert commented 2 years ago

The time on the display is also off by four hours.

The timedatectl command is showing me this:

$ timedatectl
                Local time: Fri 2021-10-29 14:17:09 EDT
           Universal time: Fri 2021-10-29 18:17:09 UTC
                 RTC time: n/a
                Time zone: America/Montreal (EDT, -0400)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
mendhak commented 2 years ago

Yep I see it now! It's really timely (haha... get it) that you raised this problem just now, as the UK returns to GMT on Monday and it would have been harder to spot. Looks like I had coded it up when UK was on GMT time :sweat_smile:

Just going to push a fix soon

mendhak commented 2 years ago

Try that, get latest on the repo, or at least on outlook_util.py. As a 'bonus' the times should now show as they'd be displayed on screen too.

DominicBoisvert commented 2 years ago

I was getting this error with the latest code:

$ python3 outlook_util.py
Traceback (most recent call last):
  File "outlook_util.py", line 12, in <module>
    from dateutil import tz
ModuleNotFoundError: No module named 'dateutil'

Running fine after sudo pip3 install python-dateutil

Thanks for your time ;-)

mendhak commented 2 years ago

Yeah just spotted that. I'll add it to the README as well.

Thanks for your time ;-)

Haha... time... get it... :rofl: