/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:
- Check
ls -l /etc/localtime, which probably shows PDT or a similar timezone;
- Update the timezone using
sudo dpkg-reconfigure tzdata, or sudo timedatectl set-timezone Etc/UTC.
/etc/timezoneand/etc/localtime.