function drupal_get_user_timezone

Same name in other branches
  1. 7.x includes/bootstrap.inc \drupal_get_user_timezone()

Returns the time zone of the current user.

Return value

string The name of the current user's timezone or the name of the default timezone.

Deprecated

in drupal:8.8.0 and is removed from drupal:9.0.0. Use date_default_timezone_get() instead.

See also

https://www.drupal.org/node/3009387

1 call to drupal_get_user_timezone()
TimeZoneDeprecationTest::testDeprecation in core/modules/system/tests/src/Kernel/TimeZoneDeprecationTest.php
@expectedDeprecation drupal_get_user_timezone() is deprecated in drupal:8.8.0. It will be removed from drupal:9.0.0. Use date_default_timezone_get() instead. See https://www.drupal.org/node/3009387

File

core/includes/bootstrap.inc, line 578

Code

function drupal_get_user_timezone() {
    @trigger_error('drupal_get_user_timezone() is deprecated in drupal:8.8.0. It will be removed from drupal:9.0.0. Use date_default_timezone_get() instead. See https://www.drupal.org/node/3009387', E_USER_DEPRECATED);
    return date_default_timezone_get();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.