Skip to main content
deleted 16 characters in body; added 35 characters in body
Source Link
Chris Down
  • 130.3k
  • 26
  • 277
  • 268

/etc/timezone is used by some applications (mostly Java applications), but /etc/localtime is typically the authoritative source of timezone information for a system. /etc/timezone is usually a symlink to a file in the /usr/share/zoneinfo directory which contains the time zone data, and it is used by most libc implementations internally when no TZ environment variable is set. systemd also adds timedatectl to control it, which you should have on Ubuntu. /etc/timezone

In your specific case, although /etc/timezone shows Etc/UTC, the output of the date command shows the time in PDT. This discrepancy usually indicates that the /etc/localtime file is set to a different time zone than what is indicated in /etc/timezone.

To verify and resolve this discrepancy:

  1. Check ls -l /etc/localtime, which probably shows PDT or a similar timezone;
  2. Update the timezone using sudo dpkg-reconfigure tzdata, or sudo timedatectl set-timezone Etc/UTC.

/etc/timezone is used by some applications (mostly Java applications), but /etc/localtime is typically the authoritative source of timezone information for a system. /etc/timezone is usually a symlink to a file in the /usr/share/zoneinfo directory which contains the time zone data, and it is used by most libc implementations internally when no TZ environment variable is set. systemd also adds timedatectl to control it, which you should have on Ubuntu. /etc/timezone

In your specific case, although /etc/timezone shows Etc/UTC, the output of the date command shows the time in PDT. This discrepancy usually indicates that the /etc/localtime file is set to a different time zone than what is indicated in /etc/timezone.

To verify and resolve this discrepancy:

  1. Check ls -l /etc/localtime, which probably shows PDT or a similar timezone;
  2. Update the timezone using sudo timedatectl set-timezone Etc/UTC.

/etc/timezone is used by some applications (mostly Java applications), but /etc/localtime is typically the authoritative source of timezone information for a system. /etc/timezone is usually a symlink to a file in the /usr/share/zoneinfo directory which contains the time zone data, and it is used by most libc implementations internally when no TZ environment variable is set. systemd also adds timedatectl to control it, which you should have on Ubuntu.

In your specific case, although /etc/timezone shows Etc/UTC, the output of the date command shows the time in PDT. This discrepancy usually indicates that the /etc/localtime file is set to a different time zone than what is indicated in /etc/timezone.

To verify and resolve this discrepancy:

  1. Check ls -l /etc/localtime, which probably shows PDT or a similar timezone;
  2. Update the timezone using sudo dpkg-reconfigure tzdata, or sudo timedatectl set-timezone Etc/UTC.
Source Link
Chris Down
  • 130.3k
  • 26
  • 277
  • 268

/etc/timezone is used by some applications (mostly Java applications), but /etc/localtime is typically the authoritative source of timezone information for a system. /etc/timezone is usually a symlink to a file in the /usr/share/zoneinfo directory which contains the time zone data, and it is used by most libc implementations internally when no TZ environment variable is set. systemd also adds timedatectl to control it, which you should have on Ubuntu. /etc/timezone

In your specific case, although /etc/timezone shows Etc/UTC, the output of the date command shows the time in PDT. This discrepancy usually indicates that the /etc/localtime file is set to a different time zone than what is indicated in /etc/timezone.

To verify and resolve this discrepancy:

  1. Check ls -l /etc/localtime, which probably shows PDT or a similar timezone;
  2. Update the timezone using sudo timedatectl set-timezone Etc/UTC.