<%
  import org.exoplatform.container.ExoContainerContext;
  import org.exoplatform.services.security.ConversationState;
  import org.exoplatform.services.organization.OrganizationService;
  import org.exoplatform.services.organization.UserProfile;

  OrganizationService organizationService = ExoContainerContext.getService(OrganizationService.class);
  String userName = ConversationState.getCurrent().getIdentity().getUserId();
  UserProfile userProfile = organizationService.getUserProfileHandler().findUserProfileByName(userName);
  String userTimezone = userProfile == null ? null : userProfile.getAttribute("user.timeZone");

%><script type="text/javascript">
  eXo.env.portal.userTimezone=<%= userTimezone == null ? "null" : "'%s'".formatted(userTimezone) %>;
</script>