traccar api /report/trips return different time than the web app

Hussah Saleh5 years ago

Dear Anton,
Thanks for the amazing system you've built.

Something weird happen while using traccar API.

When I use "/reports/route", "/reports/stops" or "/reports/events"...etc. The api returns the time attributes with UTC time which is perfect.
But, when I use "/reports/trips" it returns UTC -3 ???

In contrast, traccar web app has no problem, it returns "/reports/trips" startTime and endTime in UTC!

Is there something wrong with the api or with me :) ?

Thank you

===========SERVER DETAILS===========
Ubuntu 18.04
Traccar version > 4.3
Server time is UTC
My location where I test the app UTC + 3

Hussah Saleh5 years ago

fixed by changing the timezone of the "device" to UTC.

Dear Hussah, I am facing the same problem. on the web and in the database the date is correct, but via API this is 3 more hours. I set up UTC via the platform, but it's still wrong.
do I need to restart the platform?
or is there a specific command?

Hussah Saleh5 years ago

Not sure for restarting the server. But, my problem was the device is sending to server (+3) time. My platform was expecting that this is UTC time. So it recorded it in my database (-3) UTC.
So, the API was retrieving the exact database values which are (-3).

While traccar web app make all values (+3) since the place where am I. In this situation traccar was displaying database values(-3) +(3) my browser location. So it displays UTC :)

MAKE SURE THAT THE DEVICES SENDING UTC TIME.

Regards