I have a Django application in which a user can create an Activity, and then for an Activity create a number of Log entries. An Activity has a created datetime, and a Log entry also has a created datetime.

The Activity should be created with the timezone of the creating user at the time at which they create it. Specifically, a given user may have two Activities in separate timezones; the timezone setting is *not* per-user, but per-activity. I can derive a user's current offset from UTC in JavaScript in the browser (and I'm happy to rely on that).

What I do not know is: how do I save these times to the database, and then display them correctly on rendering?

I have USE\_TZ turned on. Here in the UK, everything works: when creating an Activity, I save the created datetime as `django.utils.timezone.now()`, and I save the user's current offset (from JavaScript) as timezoneHoursOffset in the Activity. Then, when I display the Activity and its Log entries on a page, I wrap this in `{% timezone "Etc/GMT+(timezoneHoursOffset)" %} ... {% endtimezone %}`.

However, this approach doesn't work if the server's not in the UK. The time is saved in the database as UTC (I've verified this by checking in the database itself, not using the ORM), that time is then "changed" by the ORM to be eight hours behind UTC (because the server's timezone is UTC-8) (and that gives the correct time!) and then the `{% timezone %}` tag subtracts *another* eight hours off the time, meaning that the displayed time is eight hours behind what it should be.

I'm not sure whether I should be saving the times differently; changing them on output; using the timezone template tag; or something else. This stuff is very confusing. How would you advise that I handle this situation?