charlescng / docker-containers

Docker containers and unRAID docker templates
10 stars 11 forks source link

Image and Log date/time discrepancy.. UTC vs TZ #25

Closed bcookatpcsd closed 1 year ago

bcookatpcsd commented 2 years ago

Hello sir,

I have a graph: image

and after editing the log format to show the timezone: image

The image creation is not the same as the logfile..

From 1:15 to 3:45 the power was out the graph shows 6:15, which would be UTC (I'm EST -5 atm)

Timezones info

o Date Wednesday, 15-Dec-21 07:51:46 EST o PHP -05:00 o MariaDB -05:00

./poller.php -d shows that it should be correct..

TZ was/is set correctly in the docker-compose for observium and when I enter the container it is also appearing correctly in env

Suggestions?

bcookatpcsd commented 2 years ago

so /etc/localtime in the docker image is still pointing to

/etc/localtime -> /usr/share/zoneinfo/Etc/UTC

root@db3406aabc73:/# rm /etc/localtime root@db3406aabc73:/# ln -s /usr/share/zoneinfo/America/New_York /etc/localtime

Got my graph to sync with the system time..

According to googling on the interweb this is a constant issue and I've not found an issue other than cp'ing the zonefile .. but I've yet to figure how to make it work correctly..

Again thank you for your time and efforts..

charlescng commented 2 years ago

The timezone are all using the environment variable.

image

MariaDB is also reporting the correct time and timezone.

You can try mounting the host /etc/localtime if you have it set to the "right" timezone. From: https://forums.unraid.net/topic/75153-support-uberchuckie-observium/?do=findComment&comment=849796

volumes:
  - /etc/localtime:/etc/localtime:ro