Skip to content

Fix DepreciationWarning re: time zone awareness - #17

Merged
jakehadar merged 2 commits into
jakehadar:masterfrom
kjcole:fixes
Jul 31, 2026
Merged

Fix DepreciationWarning re: time zone awareness#17
jakehadar merged 2 commits into
jakehadar:masterfrom
kjcole:fixes

Conversation

@kjcole

@kjcole kjcole commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

In examples/basic_usage.py compute staleness with time-aware datetimes:

import pytz
...
    staleness = datetime.datetime.now(datetime.UTC)  - station_status.get('last_updated').replace(tzinfo=pytz.utc)

Comment thread gbfs/examples/basic_usage.py Outdated

staleness = datetime.datetime.utcnow() - station_status.get('last_updated')

staleness = datetime.datetime.now(datetime.UTC).replace(tzinfo=None) - station_status.get('last_updated')

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like it

@jakehadar
jakehadar merged commit 7277226 into jakehadar:master Jul 31, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants