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

timezone question

EQnoble

Well-known member
#1
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...

Code:
$visitor.timezone
 

Onimua

Well-known member
#2
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:
Code:
{xen:helper dump, $visitor}
The condition you want if you only want it for logged-in users would be similar to this one:
HTML:
<xen:if is="{$visitor.user_id} AND {$visitor.timezone} == 'America/New_York'">Your content/link here</xen:if>
 

EQnoble

Well-known member
#3
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:
Code:
{xen:helper dump, $visitor}
The condition you want if you only want it for logged-in users would be similar to this one:
HTML:
<xen:if is="{$visitor.user_id} AND {$visitor.timezone} == 'America/New_York'">Your content/link here</xen:if>
Thanks!
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?
 

EQnoble

Well-known member
#4
Thanks!
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?
For now scratch that....I figure out a workaround. Thanks for the inspiration and confirmation...I think I got this now.