Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Server timezone does not match local timezone #247

Open
jashephe opened this issue Dec 15, 2019 · 1 comment
Open

Server timezone does not match local timezone #247

jashephe opened this issue Dec 15, 2019 · 1 comment

Comments

@jashephe
Copy link
Collaborator

If you work on notes for clinic in the afternoon/evening (specifically after 6pm, given that we're currently in CST), SNHC says "Good morning, it looks like you're the first one here", etc. and has the date for Sunday. This is consistent with the server time being in UTC, not CST (6:01pm on Saturday CST is 12:01am on Sunday UTC).

@jashephe jashephe added the bug label Dec 15, 2019
@justinrporter
Copy link
Member

justinrporter commented Dec 16, 2019

Good catch. I thought we had this fixed. It's a bit more complicated than the server time vs the local time, because django is supposed to be time-zone aware. Typically, this type of problem crops up when python's datetime.datetime.now() is used instead of django.utils.timezone.now(), which is aware of the server's "local" timezone.

Presumably this error is in workup/views.py wherever the view that checks if there is a ClinicDate object for "today" is (and generates a new one if so).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants