function hook_user_login(UserInterface
$account) { $config = \Drupal::
config('system.date'
);
// If the user has a NULL time zone, notify them to set a time zone.
if (!
$account->
getTimezone() &&
$config->
get('timezone.user.configurable'
) &&
$config->
get('timezone.user.warn'
)) { \Drupal::
messenger() ->
addStatus(t('Configure your <a href=":user-edit">account time zone setting</a>.',
[ ':user-edit' =>
$account->
toUrl('edit-form',
[ 'query' => \Drupal::
destination() ->
getAsArray(),
'fragment' => 'edit-timezone',
])->
toString(),
]));
}}/**
* The user just logged out.
*
* @param \Drupal\Core\Session\AccountInterface $account
* The user object on which the operation was just performed.
*/