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

Incorrect time displayed for submissions and comments #2276

Open
61izzy opened this issue Aug 17, 2023 · 3 comments
Open

Incorrect time displayed for submissions and comments #2276

61izzy opened this issue Aug 17, 2023 · 3 comments

Comments

@61izzy
Copy link

61izzy commented Aug 17, 2023

When I check the time of a submission or comment, it displays it in UTC instead of EDT, even though I selected Toronto as my time zone.

@61izzy
Copy link
Author

61izzy commented Aug 22, 2023

I tested a few other time zones, and they all seem to display UTC time as well.

@kiritofeng
Copy link
Member

I suspect this is because

return mark_safe(f'<span data-iso="{time.astimezone(utc).isoformat()}" class="time-with-rel"'
has the UTC timezone hardcoded. We could considering passing the timezone and defaulting to UTC if no time zone is provided.

@61izzy
Copy link
Author

61izzy commented Aug 23, 2023

I'm not too sure what line 30 does, but it doesn't seem to change the time being displayed when I mess around with it. However, it does make recent submissions display the date rather than "x minutes ago" or "x hours ago". I think the issue is that when assigning abs_time, time is never converted to the user's time zone.

61izzy added a commit to 61izzy/online-judge that referenced this issue Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants