Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezones #182

Merged
merged 4 commits into from
Oct 14, 2024
Merged

Timezones #182

merged 4 commits into from
Oct 14, 2024

Conversation

charliemirabile
Copy link
Contributor

Make containers timezone aware to provide user friendly dates/timestamps in local time.

There is a global timezone per instance that defaults to eastern time in .env, but can be overridden using an environment variable like the hostname/version/deployment.

@michael-burke4
Copy link
Contributor

Orbit session token expiry is still reported in GMT
Screenshot from 2024-10-07 14-44-30

@michael-burke4
Copy link
Contributor

The activity log should report what time zone these timestamps are in.
Screenshot from 2024-10-07 15-01-05

Other places have one package per line to make it easier to add and remove
packages without encountering merge conflicts.
Add a new configuration variable to .env (that can be overriden per
deployment like the others) to specify the timezone for the class
instance.

This will make the times and dates in the logs and the output of
orbit display in local time instead of UTC which is more user friendly.
The function is deprecated and shold not be used:
```
$ python3 -c 'import datetime; datetime.datetime.utcnow()'
<string>:1: DeprecationWarning: datetime.datetime.utcnow() is deprecated
and scheduled for removal in a future version. Use timezone-aware
objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
```

We can rely on Max-Age to be sufficient for expiring the cookies, any user
agents that are too old to support it can simply have the cookie not
expire which isn't a huge deal, since their expiration is obviously
checked server side.
By converting the python datetime objects to timezone aware ones with the
`.astimezone()` function, the isoformat function will include the UTC
offset.
Copy link
Contributor

@michael-burke4 michael-burke4 left a comment

Choose a reason for hiding this comment

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

lgtm

@michael-burke4 michael-burke4 merged commit 9d071c9 into master Oct 14, 2024
@michael-burke4 michael-burke4 deleted the timezone branch October 14, 2024 21:24
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