Times

Richard Creer 7 years ago

I see that Traccar Client sends just one time stamp which is used as both devicetime and fixtime. Fair enough.

But elsewhere in these forums I read that Traccar Server expects to receive UTC times yet the times I see are the phone's local times, in my case BST. Is there a setting somewhere I have missed to make Client send UTC? If not it seems to me that there is an opportunity for confusion if non-Traccar Client devices are sending UTC and but Traccar Client devices aren't.

Anton Tananaev 7 years ago

Traccar Client should be sending UTC timestamp. Can you please provide some evidence that it doesn't.

Richard Creer 7 years ago

Here's the last entry in the server log from a few minutes ago. It's now 1752 BST:

2018-09-11 17:50:15 DEBUG: [3cb2e4ce: 5055 < 62.3.226.214] HEX: 504f5354202f3f69643d3634353731342674696d657374616d703d31353336363834363133266c61743d35302e3834303638343039266c6f6e3d2d302e39333034383039322673706565643d302e302662656172696e673d302e3026616c7469747564653d35352e302661636375726163793d302e3026626174743d39302e3020485454502f312e310d0a436f6e74656e742d547970653a206170706c69636174696f6e2f782d7777772d666f726d2d75726c656e636f6465640d0a557365722d4167656e743a2044616c76696b2f322e312e3020284c696e75783b20553b20416e64726f696420382e302e303b204f4e45504c5553204133303033204275696c642f4f5052312e3137303632332e303332290d0a486f73743a2036322e332e3232362e3231343a353035350d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a20677a69700d0a436f6e74656e742d4c656e6774683a20300d0a0d0a
2018-09-11 17:50:15 DEBUG: [3cb2e4ce: 5055 > 62.3.226.214] HEX: 485454502f312e3120323030204f4b0d0a636f6e74656e742d6c656e6774683a20300d0a0d0a
2018-09-11 17:50:15  INFO: [3cb2e4ce] id: 645714, time: 2018-09-11 17:50:13, lat: 50.84068, lon: -0.93048, course: 0.0
Richard Creer 7 years ago

I should have added 1752 BST is 1652 UTC.

Anton Tananaev 7 years ago

Here is the timestamp that device sends:

timestamp=1536684613

It converts to 16:52 UTC, so your claim is incorrect.

Richard Creer 7 years ago

So where does 'time: 2018-09-11 17:50:13' in the log and the exact same fixtime in tc_positions come from? Does Traccar Server adjust device timestamps to the server's local time?

Anton Tananaev 7 years ago

Of course it prints it in server local time.

Richard Creer 7 years ago

So to clarify, Traccar server expects devices to provide times in UTC and then converts them to local time for storage in the database and server log. I guess if you want the times to stay as UTC you need to run the server in UTC.

Anton Tananaev 7 years ago

Database also usually stores UTC, but it depends on the database engine.