Back to Gitlabhq

Change your time zone

doc/administration/timezone.md

18.11.22.2 KB
Original Source

{{< details >}}

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab Self-Managed

{{< /details >}}

[!note] Users can set their time zone in their profile. New users do not have a default time zone and must explicitly set it before it displays on their profile. On GitLab.com, the default time zone is UTC.

The default time zone in GitLab is UTC, but you can change it to your liking.

To update the time zone of your GitLab instance:

  1. The specified time zone must be in tz format. You can use the timedatectl command to see the available time zones:

    shell
    timedatectl list-timezones
    
  2. Change the time zone, for example to America/New_York.

{{< tabs >}}

{{< tab title="Linux package (Omnibus)" >}}

  1. Edit /etc/gitlab/gitlab.rb:

    ruby
    gitlab_rails['time_zone'] = 'America/New_York'
    
  2. Save the file, then reconfigure and restart GitLab:

    shell
    sudo gitlab-ctl reconfigure
    sudo gitlab-ctl restart
    

{{< /tab >}}

{{< tab title="Helm chart (Kubernetes)" >}}

  1. Export the Helm values:

    shell
    helm get values gitlab > gitlab_values.yaml
    
  2. Edit gitlab_values.yaml:

    yaml
    global:
      time_zone: 'America/New_York'
    
  3. Save the file and apply the new values:

    shell
    helm upgrade -f gitlab_values.yaml gitlab gitlab/gitlab
    

{{< /tab >}}

{{< tab title="Docker" >}}

  1. Edit docker-compose.yml:

    yaml
    version: "3.6"
    services:
      gitlab:
        environment:
          GITLAB_OMNIBUS_CONFIG: |
            gitlab_rails['time_zone'] = 'America/New_York'
    
  2. Save the file and restart GitLab:

    shell
    docker compose up -d
    

{{< /tab >}}

{{< tab title="Self-compiled (source)" >}}

  1. Edit /home/git/gitlab/config/gitlab.yml:

    yaml
    production: &base
      gitlab:
        time_zone: 'America/New_York'
    
  2. Save the file and restart GitLab:

    shell
    # For systems running systemd
    sudo systemctl restart gitlab.target
    
    # For systems running SysV init
    sudo service gitlab restart
    

{{< /tab >}}

{{< /tabs >}}