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

timezone question

Discussion in 'XenForo Development Discussions' started by EQnoble, Mar 12, 2013.

  1. EQnoble

    EQnoble Well-Known Member

    Is it possible for me to check and get the timezone setting of a logged in member viewing a page?

    I am thinking I need to use this but not sure...

  2. Onimua

    Onimua Well-Known Member

    That would be the one, yes. If you're curious about the specifics, you could always use this code to see what's available for the $visitor variable (or any really) in the template:
    {xen:helper dump, $visitor}
    The condition you want if you only want it for logged-in users would be similar to this one:
    <xen:if is="{$visitor.user_id} AND {$visitor.timezone} == 'America/New_York'">Your content/link here</xen:if>
    EQnoble likes this.
  3. EQnoble

    EQnoble Well-Known Member

    Well what I am trying to do is this....in your example:

    America/New_York has a UTC time of UTC-05:00 what i need to do is get the -05:00 if a user has selected that timezone. Is this possible...or will I have to make a list of all of the timezones and the appropriate adjustments to make?
  4. EQnoble

    EQnoble Well-Known Member

    For now scratch that....I figure out a workaround. Thanks for the inspiration and confirmation...I think I got this now.

Share This Page