Skip to content

Display post times in local time #303

@macumhail

Description

@macumhail

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions