What I want is to change the way drupal views get the site's timezone setting. I want to set it manually in code.

Searching through the files I noticed that the function "views_get_timezone()" in sites/all/modules/views/includes/handlers.inc @1182 (drupal 7) is responsible for getting the timezone and setting the session.time_zone in mysql, but when I change it nothing happens.

Any suggestion anyone for this or any similar solution? I just want to make a site with multiple timezones for anonymous users so I want to change the session.time_zone in mysql according the user location.


1 Answer 1


If you want to change the time zone, the option is available in admin menu in:

  • admin/settings/date-time in Drupal 6
  • admin/config/regional/settings in Drupal 7

And it can be defined in settings.php as date_default_timezone

It can be accessed in Database in variables table too

SELECT *  FROM variable WHERE name LIKE  '%timezone%'
  • Like I said I want to change it in code overriding the timezone default setting.
    – Cookforweb
    Commented Nov 5, 2014 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.