Traccar server / client time mismatch

Adam6 years ago

I'm getting a mismatch between my traccar server time and the time the device is sending out. At first, I thought the time was incorrect on my device however after checking the logs I can see the device is sending the correct time, however Traccar's server timestamp is way off the mark.

Here's an excerpt from tracker-server.log:

2018-07-17 00:00:51  INFO: [9FDAD1E4] id: 3587350723XXXXX, time: 2018-07-16 08:35:08, lat: 50.65244, lon: -2.45863, speed: 20.0, course: 285.0
2018-07-17 00:00:51  INFO: [9FDAD1E4] id: 3587350723XXXXX, time: 2018-07-16 08:35:05, lat: 50.65228, lon: -2.45828, speed: 23.2, course: 324.0
2018-07-17 00:00:51  INFO: [9FDAD1E4] id: 3587350723XXXXX, time: 2018-07-16 08:34:57, lat: 50.65150, lon: -2.45813, speed: 17.3, course: 44.0

My time-zone on the ubuntu server is Europe/London:

root@server-8:~# dpkg-reconfigure tzdata

Current default time zone: 'Europe/London'
Local time is now:      Tue Jul 17 11:36:25 BST 2018.
Universal Time is now:  Tue Jul 17 10:36:25 UTC 2018.

I haven't made any changes to traccar configuration files that I can contribute to this change, if any more information is required please let me know :-)

Anton Tananaev6 years ago

Where do you see correct time? I see that server time is 2018-07-17 00:00 and device is reporting 2018-07-16 08:35.

Adam6 years ago

Hi Anton, the server timestamp of midnight (00:00:51) is 8Hr:35min out! All my tracking data is 8hr:35min out, I don't know why. I have checked the time on my server and it shows as current/true, I cannot understand the mis-match!

Anton Tananaev6 years ago

Check timezone using timedatectl utility.

Adam6 years ago

Hi Anton, as requested:

ubuntu@server-8:~$ timedatectl
      Local time: Tue 2018-07-17 21:01:14 BST
  Universal time: Tue 2018-07-17 20:01:14 UTC
        RTC time: Tue 2018-07-17 20:01:14
       Time zone: Europe/London (BST, +0100)
 Network time on: yes
NTP synchronized: no
 RTC in local TZ: yes
Anton Tananaev6 years ago

I guess there is still some issue with Java timezone somewhere. Try forcing timezone. There are a few thread about it on forum.

P.S. You can use triple-back-ticks to format blocks instead of doing it line by line.

Adam6 years ago

Hi Anton, thank you for the speedy replies!

I have searched high and low for the correct configuration settings, I even checked https://www.traccar.org/configuration-file/ and cannot see a way to force Java to use the timezone of my choosing :-(

(Also thank you for the tip on triple back ticks - Very useful!)

Anton Tananaev6 years ago