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

How to get Client timeZone date and time in Logs #237

Open
rshnGhost opened this issue Jul 25, 2022 · 2 comments
Open

How to get Client timeZone date and time in Logs #237

rshnGhost opened this issue Jul 25, 2022 · 2 comments

Comments

@rshnGhost
Copy link

rshnGhost commented Jul 25, 2022

The Current audit logging (loginevent) has datetime as server, but need user timezone

will require to add pytz and utilize from django.utils import timezone , but not sure how to change it

requesting assistance @soynatan [Natán]

@rshnGhost
Copy link
Author

rshnGhost commented Jul 25, 2022

lets say there are 2 users, [user1 is in timezone GMT+1 and user2 is in timezone GMT+4] and server in GMT+3
but in record added on login, both user will be logged in at server time, and unable to show them user timezone date and time

it would be helpful to able like in django:user lastlogin field

@jheld
Copy link
Collaborator

jheld commented Sep 30, 2022

If possible, I would recommend trying to resolve this from the application code.

https://docs.djangoproject.com/en/4.1/topics/i18n/timezones/#time-zone-aware-output-in-templates (and generally speaking the related sections in that same page with respect to the other configurable machinery of datetime in django).

If there is a way to accomplish this without being a large burden on your code-base, but you are unsure of how you might, would you be able to share some snippets of code or anonymized/example snippets of code to help aid us in finding a solution?

If all fails, we will consider adding the support into the library.

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

No branches or pull requests

2 participants