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

Display post times in local time #303

Open
macumhail opened this issue Jun 7, 2023 · 0 comments
Open

Display post times in local time #303

macumhail opened this issue Jun 7, 2023 · 0 comments

Comments

@macumhail
Copy link

I want post times to be displayed to users in their local times. I have TIME_ZONE = 'UTC' and USE_TZ = True in my settings.py file. I have also installed "pytz." The times are currently displayed in UTC time.

I have attempted to use the following in a template:

 <small>{{ node.last_post.created | localtime }}</small>

However this has no effect on the display times.

I put this in the template as a test:

{% get_current_timezone as TIME_ZONE %}
        {{ TIME_ZONE }}

and it displays "UTC"

How can I get the times to display in the user's local time zone?

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

1 participant