problem with timezone and times from GPS devices

chrisGERa year ago

Hey guys,
we just set up a traccar server on debian 12, linux with mysql database but i'm not able to solve the problem with the timezone. We are in Europe, Germany, Berlin. We have connected a S20 WanWayTech GPS-Tracker with custom Rom and an iPhone. Booth devices deliver the correct timestamp (thats what i see in the log) but in the database, there is the wrong timestamp.

When we then want to add the traccar server to our EDP-Server all values are discarded because they are to old. So how do i get the server to safe the GPS-Data with the correct timestamp? On the frontend-side (in the browser) everything is fine, but like i said: When our third-party system gets the data from the API, it delivers the "wrong" timestamp and our system says "outdated" and disregards the value - we are not able to modify the system, we need to modify the data in the database.

GPS-Data, ip-addresses and other private data on Screenshots are random/edited, don't worry.

https://de.directupload.net/file/d/8518/bbm2hgjt_png.htm

https://de.directupload.net/file/d/8518/jg4yqzx3_png.htm

https://de.directupload.net/file/d/8518/vl28ddbh_png.htm

Anton Tananaeva year ago

You redacted the most valuable info from the logs - server time.

chrisGERa year ago

Hey @Anton, sorry for that, here we have a picture with the server time -> https://de.directupload.net/file/d/8518/nxsnocwx_png.htm

And here is the raw code from the screenshot -> https://pastebin.com/nw6dPX4h

Anton Tananaeva year ago

I see that the device time matches with the server time, which means that everything looks correct there. What's the problem with the database timezone? We don't even store timezone in the database.

chrisGERa year ago

Yes, thats right, and in the database the value from the tracker than is 2 hours lower then it was sended. You see on the screenshots (not the logfile, thats from today) around 0:55 o'clock but all values in database are 22:55 o'clock - 2 hours less than we have actual in germany. And then, when the Software accesses the data, the value from the database is given with 2 hours less. So how can i store the exact time the device has sent in the database without decreasing it. Just taking the value from the device, saving it. :)

Hope you understand what i mean

Anton Tananaeva year ago

What is your database configuration? Have you checked the timezone there?

What software are you talking about? Are you talking about the official app?