allinurl/goaccess

Timezone offset only affects top-right timestamp, not Time Distribution panel

Closed this issue · 6 comments

I’m running GoAccess with Nginx on Ubuntu. My server’s timezone is set to UTC+00:00, but I need GoAccess reports to display times in UTC+05:00, without changing the server’s timezone.

What I tried

  • Changed timezone in Nginx configuration → no effect.
  • Updated timezone in GoAccess configuration file (goaccess.conf) → this only updates the top-right report timestamp, but does not affect the Time Distribution panel.
  • Tried other methods (environment variables, log format tweaks) but none worked for the distribution chart.

Actual behavior

  • Top-right timestamp correctly shows UTC+05:00 after config change.
  • Time Distribution section still shows times in UTC+00:00 (server timezone).

Expected behavior

  • GoAccess should apply the configured timezone consistently across all panels, including Time Distribution, not only the top-right timestamp.

Environment

  • OS: Ubuntu (server timezone: UTC+00:00)
  • GoAccess version: [add your version, e.g. 1.9.2]
  • Web server: Nginx

You'll need to use %x for the date/time and then pass --tz=America/New_York to GoAccess. e.g.,

 # goaccess access.log --log-format='%h %^[%x] "%r" %s %b "%R" "%u" %^' --datetime-format='%d/%b/%Y:%H:%M:%S %z' --tz=America/New_York --date-spec=min

You'll need to use %x for the date/time and then pass --tz=America/New_York to GoAccess. e.g.,

 # goaccess access.log --log-format='%h %^[%x] "%r" %s %b "%R" "%u" %^' --datetime-format='%d/%b/%Y:%H:%M:%S %z' --tz=America/New_York --date-spec=min

Thanks for the response,
as I am using the run.sh file with pm2 for Goaccess and I made some changes in your provided command, the run.sh file as below:
goaccess /var/log/nginx/access.log
--log-format='%h %^[%x] "%r" %s %b "%R" "%u" %^'
--datetime-format='%d/%b/%Y:%H:%M:%S %z'
--tz=Asia/Karachi
--date-spec=min
-o /var/www/html/Shadow-server-report.html

but still the dashboard shows the server's time not the required one.

Feel free to post a few lines from your access log and I can take a look.

Feel free to post a few lines from your access log and I can take a look.

nginx access logs:
101.44.162.177 - - [02/Sep/2025:05:01:29 +0000] "\x04\x01\x00PpTi4\x00" 400 166 "-" "-" uri="-" file="/usr/share/nginx/html"
101.44.162.177 - - [02/Sep/2025:05:01:29 +0000] "\x04\x01\x00PpTi4\x00" 400 166 "-" "-"
180.149.125.165 - - [02/Sep/2025:05:07:08 +0000] "GET /stalker_portal/server/tools/auth_simple.php HTTP/1.1" 404 196 "-" "Mozilla/5.0 (Windows NT 5.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36" uri="/stalker_portal/server/tools/auth_simple.php" file="/var/www/html/stalker_portal/server/tools/auth_simple.php"
180.149.125.165 - - [02/Sep/2025:05:07:08 +0000] "GET /stalker_portal/server/tools/auth_simple.php HTTP/1.1" 404 196 "-" "Mozilla/5.0 (Windows NT 5.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36"

grep log_format /etc/nginx/nginx.conf
log_format with_path '$remote_addr - $remote_user [$time_local] '

Give this a shot:

# goaccess access.log --log-format='%h %^[%x] "%r" %s %b "%R" "%u" %^' --datetime-format='%d/%b/%Y:%H:%M:%S %z' --tz=America/Chicago --date-spec=min
Image

goaccess access.log --log-format='%h %^[%x] "%r" %s %b "%R" "%u" %^' --datetime-format='%d/%b/%Y:%H:%M:%S %z' --tz=America/Chicago --date-spec=min

Thanks alot, finally solved my problem.