Changed server time but traccar log still use old time after restart

Andersa month ago

I have Traccar installed on a Linux 24.04 vps. Installed in yesterday. Today I realized that the server had wrong timezone so I changed it. Then I restarted traccar but I see that the times in the logfile does not change. What can I do about it? All other logs like php, apache has the correct time

Andersa month ago

This is log for the start. 7 hours wrong

2024-11-27 11:09:35  INFO: Started Server@45673e05{STARTING}[11.0.24,sto=0] @16395ms

And this is the server time

Wed Nov 27 18:11:35 CET 2024
Anton Tananaeva month ago

It means Java is taking timezone from some other place. Just FIY fiddling with timezone on Linux is tricky. There are multiple sources of truth. I strongly recommend against it.

Andersa month ago

Well I have always fixed the timezone to be correct wherever in the world the vps is setup. I use this and have not had any problem
timedatectl set-timezone [new/time_zone]

A logfile that show incorrect time is useless

Anton Tananaeva month ago

It doesn't seem like you fully read my message.

Andersa month ago

I read that you say changing timezone in Linux is tricky. Why should a VPS in Frankfurt have a US central Timezone?
I also read that Java take the time from somewhere else. Where? FYIO before I changed the timezone all logs had the same US time. Only Traccar log did not change after rebooting the vps

Anton Tananaeva month ago

Where?

That's why it's tricky. You have do your research on how to change the timezone in all the different places. Let us know if you figure it out.

And just to clarify, this is not something specific to Traccar. If you haven't noticed any other places, it doesn't mean they don't exist. Java is used by many apps and I bet all of those will have the same issue. Probably some other software as well.

Andersa month ago

I know how to change timezone in all places I need it. I have not said its specific for traccar, we probably just dont have stumbled on any java. We have Email servers Nextcloud servers Piwigo servers, Matomos servers. and a lot of surrounding software. But Ok
It still does not change the fact that a logfile with wrong timezone is if not useless, its much harder to use if you always has to recalculate the time

Anton Tananaeva month ago

Most of our servers are in UTC timezone. It's actually somewhat of an industry standard. It is useful because most GPS devices also report UTC timezone. So I disagree with your point of uselessness.

But as I said, it is all configurable. That configuration is not a part of Traccar. It's part of your system.

Andersa month ago

And I have configured it. Google it and there come loads of problem with java time mostly because the time db is not updated. I will live with the traccar log