1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cannot Reproduce Error in timezone selection

Discussion in 'Resolved Bug Reports' started by giorgino, Feb 25, 2012.

  1. giorgino

    giorgino Well-Known Member

    In ACP I've set

    Google Chrome 2.png

    but in the the registration page appear:

    Parallels Desktop 2.png
  2. Mike

    Mike XenForo Developer Staff Member

    The registration page tries to guess your timezone based on your computer's settings. I will check to see what's if it's trying to use that over what you've selected. Unfortunately, it's not possible to necessarily guess 100% correctly because we don't have enough information and there are many timezones that are roughly identical.
  3. giorgino

    giorgino Well-Known Member

    Thank you Mike, can I set manually the registration page timezone?
  4. digitalpoint

    digitalpoint Well-Known Member

    Another option would be if XenForo determined the timezone based on the user's geographical location (the geoip extension has a function for doing just that). Of course not every PHP install is going to have the geoip extensions, but for the ones that do, it would be cool.

    Off the top of my head...

    if (function_exists('geoip_time_zone_by_country_and_region'))
    $timeZone geoip_time_zone_by_country_and_region(@geoip_country_code_by_name($_SERVER['REMOTE_ADDR']), @geoip_region_by_name($_SERVER['REMOTE_ADDR']));
    Of course you could make it a little fancier, like use the browser detection method if they don't have geoip extensions or if it can't determine the exact region.
    TheVisitors likes this.
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> register_form

    Remove the red code:

    	<dl class="ctrlUnit">
    		<dt><label for="ctrl_timezone">{xen:phrase time_zone}:</label></dt>
    			<select name="timezone" class="textCtrl {xen:if $fields.timezoneAuto, 'AutoTimeZone'} OptOut" id="ctrl_timezone">
    				<xen:foreach loop="$timeZones" key="$identifier" value="$name">
    					<option value="{$identifier}" {xen:selected "{$identifier} == {$fields.timezone}"}>{$name}</option>
    Then it will use the guest timezone you set in the Admin CP.
    giorgino likes this.
  6. giorgino

    giorgino Well-Known Member

    Great Jake! Thank you :)
  7. Mike

    Mike XenForo Developer Staff Member

    If I set my time zone in Windows to CET, I get that picked correctly. West Central Africa time should be used if you don't follow DST though.

    What browser and OS are you using?
  8. giorgino

    giorgino Well-Known Member

    MacOsX Lion + Safari/Chrome
  9. Mike

    Mike XenForo Developer Staff Member

    Just checked with someone on OS X Lion and they couldn't reproduce it in Safari/Chrome (they're set to CET in Amsterdam). What's your specific OS X TZ setting?

    Can you try in Firefox?

    Can anyone else reproduce this?
  10. giorgino

    giorgino Well-Known Member

    I've tried on windows (with Parallels) (IE, FF, S and C) and OsX (FF, S and C) with the same issue.

    Schermata 03-2456003 alle 16.19.38.png
  11. Floris

    Floris Guest

    I checked on my iMac, with Chrome/Safari; Can't reproduce.​
    I checked on the Mac Pro server, with C/S; Can't reproduce.​
    Both were on Lion.​
    I checked with older versions of Safari and Chrome on Snow Leopard on a Mac Book Pro at a different provider, which never visited xenforo sites, and here, xenfans, and another site, can't reproduce. ​
    Can you confirm that you also have this problem on XenForo.com here and not just your own forum?​
    Which version of PHP are you using where this happens? If it's pre 5.4, has the timezone been set manually in the php configuration file?​
    When you go to mrfloris.com/tz and load it, then copy the source code and put a temporary .html file on your own server and load that. Then compare the results, are they any different (except from say, a minute has passed)?​

Share This Page