MycroftAI / skill-weather

Mycroft AI official Weather Skill, providing weather conditions and forecasts.
https://mycroft.ai/skills
Apache License 2.0
19 stars 59 forks source link

Bugfix/sunset time #184

Closed krisgesling closed 3 years ago

krisgesling commented 3 years ago

Description

This fixes two issues:

  1. The name of the sunset and sunrise dialogs was using periods instead of the new dashes
  2. On systems where the system clock had it's timezone set to non-UTC, the sunrise and sunset times were incorrectly reported. datetime.fromtimestamp by default will return a local time but was being treated as a UTC time.

Type of PR

Testing

Run Mycroft on a regular desktop (your clock is most likely set correctly) ask "what time is the sunset"

CLA

krisgesling commented 3 years ago

Just realised I could simplify this and that the docstring was potentially leading people astray.

The timestamp passed in isn't "assumed" to be UTC. It is in an inherently timezone naive format - seconds since the epoch. Unless I'm mistaking something