Closed (won't fix)
Project:
Timezone Detect
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Jan 2014 at 12:08 UTC
Updated:
25 Mar 2021 at 18:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jordanmagnuson commentedCurrently this module does not support setting a timezone for anonymous users.
It should be possible, though, to use the timezone detect library to grab the anonymous user's timezone, and then save it in the global $_SESSION variable, e.g. as $_SESSION[‘timezone’].
See https://drupal.org/node/1985906 .
Comment #2
jordanmagnuson commentedComment #3
sanjay.maharjan commentedIs this problem solved?? I want to show the time of my event to anonymous user according to his/her local time. How can I achieve such functionality?
Comment #4
jordanmagnuson commentedSee #1: There is no "built in" functionality for this in the module. It should be possible, though, to use the timezone detect library to grab the anonymous user's timezone, and then save it in the global $_SESSION variable, e.g. as $_SESSION[‘timezone’].
Comment #5
ivanbueno commentedI, too, need this feature...
Attached is a patch that implements #1. However,
$_SESSION['timezone']is no longer used by Drupal 7.x. (It was used in Drupal 5.)There is no way to override anon's timezone without hacking core.
In drupal_session_initialize(), the timezone is set using:
date_default_timezone_set(drupal_get_user_timezone());And drupal_get_user_timezone() does not allow any alterations:
Let me know if I'm missing anything.
Comment #6
Anonymous (not verified) commentedComment #8
jordanmagnuson commentedWon't fix this, since it seems to require a core hack. Those who need the functionality can hack core as required, or petition for the required core code changes.