Setting anonymous user timezone on page load I'm developing a radio site where show times are displayed. Since it's an Internet radio station, I need to be able to display times in the user's timezone.

I'm able to detect which timezone a user is using (eg. Europe/London), but I don't know how to make Drupal use that timezone.

Is there any way to programmatically override Drupal's default timezone to instead use the timezone I detected?

I've looked through the documentation, but I have not been able to find a way for achieving this.
drupal_get_user_timezone() is the main function that retrieves the user's zone (based on a configured user setting, site setting, or PHP's date_default_timezone_get() depending on site/user settings). 

This function's implementation is based off of retrieving configuration settings and native PHP function. There's no way to override that short of 
trying to redefine to this function (if you don't mind a solution that is a bit of hack).

An alternative to that would provide some wrapper function in a custom module. For example:

function mymodule_get_timezone() {
  // @TODO: At timezone lookup retrieval based on IP/Whatever
}

function mymodule_get_user_timezone() {
  // Or \Drupal::currentUser()-&gt;isAnonymous() in D8
  return user_is_anonymous() ? mymodule_get_timezone() : drupal_get_user_timezone();
}


Then reference mymodule_get_user_timezone() wherever you need to insert your own discovered timezone.