Time Zone

traccargps12 years ago

hi,

linux server (command date) and mysql (select now();). time are correct. in database.url I put the serverTimezone=UTC-3
even with all these adjustments, the time has been adding 3 hours more

How do I save my country's servertime?

Anton Tananaev2 years ago

What time do you see in Traccar logs? Does it match your server time?

In general you should never need to mess up with timezones.

traccargps12 years ago
sudo tail -f /opt/traccar/logs/tracker-server.log
2023-01-19 21:31:10  INFO: [T1dc4022a] id: xxxxxx, time: 2023-01-19 21:31:01, lat: xxxxx, lon: xxxxx, course: xxxx

here is 18:32

traccargps12 years ago

where I do the configuration to put the correct time in Brazil !

Anton Tananaev2 years ago

It looks like you haven't configured the timezone in all the places in your OS. Java still gets the wrong time. One option is to explicitly specify the timezone with something like -Duser.timezone=XXX in the command line. Add it to the traccar.service file in the systemd config.

homa5 months ago

I have this trouble too, but in docker container I can't change timezone for traccar. Default metods is not work

    environment:
      TZ: "Europe/Moscow"

or

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

but in server logs I have gmt+3 time and in docker container I have UTC time
-Duser.timezone=XXX - show

root@docker1:/gluster/docker/traccar# docker logs -f traccar
2024-06-13 12:44:23 ERROR: Main method error - -Duser.timezone=Europe/Moscow (No such file or directory) - FileNotFoundException (... < Config:44 < <gener:-1 < *:-1 < ... < Main:116 < ...)