2 * Implements hook_user_login().
4 function {{ machine_name }}_user_login(UserInterface $account) {
5 $config = \Drupal::config('system.date');
6 // If the user has a NULL time zone, notify them to set a time zone.
7 if (!$account->getTimezone() && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) {
9 ->addStatus(t('Configure your <a href=":user-edit">account time zone setting</a>.', [
10 ':user-edit' => $account->url('edit-form', [
11 'query' => \Drupal::destination()
13 'fragment' => 'edit-timezone',