Wiki article was last changed tomorrow

Bug #811686 reported by Hans Joachim Desserud
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Widelands Website
Fix Released
Medium
Unassigned

Bug Description

When users are logged in, wiki changes or forum posts from the same day is converted from the actual date to "today". This is quite neat, however it is strangely enough possible to edit a wiki article and be informed that it was last changed tomorrow. I managed to trigger this by updating an article late in the evening. I use default time zone / time display.

I assume the reason is due to differences between time zones near midnight which turns what is today in one time zone into tomorrow in another. Still it looks a bit weird. I am not sure if this is solvable without removing the conversion from [current_date] to "today". I am not sure if it should be done either, as I can easily live with the current behaviour.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :
janus (janus-jhor)
Changed in widelands-website:
importance: Low → Medium
status: New → In Progress
kaputtnik (franku)
Changed in widelands-website:
status: In Progress → Confirmed
Revision history for this message
kaputtnik (franku) wrote :

We may have to consider the whole timezone support in our project. For example we use

USE_TZ=False

which causes the using of local time, afaik.

See: https://docs.djangoproject.com/en/1.10/topics/i18n/timezones/
Especially when changing USE_TZ: https://docs.djangoproject.com/en/1.10/topics/i18n/timezones/#migration-guide

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Timezones and USE_TZ was also briefly discussed in an earlier attempt to upgrade to a newer Django version (https://code.launchpad.net/~shevonar/widelands-website/django1.4/+merge/143219). I haven't been paying too close attention, but from what I've understand Django has been upgraded in the mean time. I think it was intially delayed since it would require updating the existing timestamps in the db, and that it wasn't a requirement for newer Django which was the main focus. As you say, it might be time to look more into this again.

Revision history for this message
kaputtnik (franku) wrote :

I think the main reason for this is the value '3' in the setting:

DEFAULT_TIME_ZONE = 3

From my understanding this value is used to get the servers timezone in

http://bazaar.launchpad.net/~widelands-dev/widelands-website/trunk/view/head:/wlprofile/templatetags/custom_date.py#L75

Changing DEFAULT_TIME_ZONE to '1', which is the addition from UTC to Germany, should fix this (as long there is no DST :-D ).

Revision history for this message
kaputtnik (franku) wrote :

Overwritten:

DEFAULT_TIME_ZONE = 3

in local_settings.py as:

# For testing about posts in future
DEFAULT_TIME_ZONE = 1 # 3 by default

This works as expected (imho also for DST). Should we change it in settings.py?

kaputtnik (franku)
Changed in widelands-website:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints