You are here

function drupal_get_user_timezone in Drupal 8

Same name and namespace in other branches
  1. 7 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
Functions that need to be loaded on every Drupal request.

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();
}