User's time zone may be erroneously overwritten with Pacific/Midway

PaulB

Well-known member
Affected version
2.2.11
Forums that have been around awhile likely have users with time zones that aren't recognized by recent versions of XenForo, but that were historically used by XenForo or other forum software. For example, Australia/Hobart is still used by XFI, but XF itself doesn't recognize it as a time zone. On NamePros, this time zone alone has been inadvertently replaced with Pacific/Midway 172 times.

When a user's time zone isn't recognized, /account/preferences and /admin.php?users/edit will display their time zone as Pacific/Midway, as that's the first option in the list of recognized time zones. This causes the user's time zone to be overwritten with a bogus value any time the user changes their preferences or an admin edits the user.

As a side note, it's not clear to me why Australia/Hobart is currently omitted from XenForo, as it's a canonical time zone with no other canonical equivalent. Australia/Melbourne and Australia/Sydney are aligned with Australia/Hobart at this moment in time, but they weren't the same historically--and old forums have old content with old dates. As a simple example, take the Unix epoch: at timestamp 0, it was 10 AM in Australia/Melbourne but 11 AM in Australia/Hobart:
Code:
% for i in Australia/{Melbourne,Hobart}; do printf '%-19s = ' "$i"; TZ="$i" date --date=@0; done
Australia/Melbourne = Thu Jan  1 10:00:00 AEST 1970
Australia/Hobart    = Thu Jan  1 11:00:00 AEDT 1970

We'll be seeing more of these convergences and divergences as time goes on, even places that have historically had relatively stable time zones.
 
Last edited:
Back
Top Bottom