Fixed bug with user registration timezone

Affected version


Active member
Guest timezone settet up to: utc_plus_0300_moscow

After any user registration, in his profile settings timezone are equal: utc_plus_0300_baghdad

Chris D

XenForo developer
Staff member
The guest time zone effects guests, and is not necessarily the time zone that registered users will get.

We use some JavaScript and the local time of the registering user to figure it out automatically. This involves looking at the timezone UTC offset at January 1st and June 1st. The combination of these two values should tell us what the UTC offset is normally vs what it is during DST.

I think the discrepancy here might be related to changes to MSK Moscow Time in 2011 and 2014. I believe we may be using the data from what was valid in 2011 which, correct me if I'm wrong, was permanent all-year round UTC +4:00.

'-180,-240' : 'Africa/Nairobi',
'-180,-180' : 'Africa/Nairobi',
'-210,-270' : 'Asia/Tehran',
'-240,-240' : 'Europe/Moscow',

You can see here that Europe/Moscow is defined as having a UTC +4 (240 minutes) offset in both standard and summer time. But I think this changed again in 2014 and became all-year round UTC +3:00.

Africa/Nairobi is defined as having UTC +3 (180 minutes) offset in both standard and summer time. East Africa Time is therefore exactly the same as Moscow Time.

So the choices really are we either replace Africa/Nairobi with Europe/Moscow which would be correct for your users in Moscow but incorrect for other customers who have users in the Africa/Nairobi timezone or we just remove Europe/Moscow from the list and just accept that although your users will see the wrong name for the timezone, their actual times across the forum will be the same regardless because (at least currently) EAT is the same as MSK.

I know what your preference will be, of course, but we have to weigh up what is best generally.

As a workaround for now, you could simply change the contents of the utc_plus_0300_baghdad phrase to the following (or whatever you think is appropriate):

(UTC+03:00) Moscow, St. Petersburg, Volgograd


Active member
Ok, understand.

Actual Europe/Moscow dst = +3:00
Xenforo list timezones - are actual

Is possible to create (customizable in admin-panel) timezone select in register form with automatically selected guest-timezone option - or javascript-detected timezone selected? (variants are customizable in admin-panel)

Chris D

XenForo developer
Staff member
I think the easiest workaround right now for you is to modify the register_form template.

<xf:hiddenval name="{{ $regForm.getFieldName('timezone') }}" value="" data-xf-init="auto-timezone" />

Replace with:
<xf:hiddenval name="{{ $regForm.getFieldName('timezone') }}" value="Europe/Moscow" />

Once we've made a decision I'll post here what the changes in the next version will be. If we do change it so that your users will invariably get Europe/Moscow automatically then you will be able to revert the register_form template.

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.1.10).

Change log:
Correct our auto-timezone data so that UTC+3 returns Europe/Moscow as expected.
There may be a delay before changes are rolled out to the XenForo Community.