fixtime conditions

Rozik8 years ago

Hi,
I have a problem with a one device - I can not to set the date (only timezone) - the devices time is 2036-xx-xx. I have been fixed it by SQL command:

INSERT INTO positions (deviceId, protocol, serverTime, deviceTime, fixTime, valid, latitude, longitude, altitude, speed, course, address, attributes)
VALUES (:deviceId, :protocol, :now, :deviceTime, :now, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :attributes);

... but I think it isn't the good solution.. Is posible to change (somewhere) the fixtime conditions? for example: if ( devicetime > servertime) fixtime = servertime?

Anton Tananaev8 years ago

What database are you using?

Rozik8 years ago

MySQL

Anton Tananaev8 years ago

You can use some MySQL functions to modify fix date if it's too far in the future.

Rozik8 years ago

The variable fixtime is used in too many of commands in traccar config file. I need to use that only for some devices, not for all. I am not sure if a MySQL funcions will solve my problem.

My idea is something as...
Add to config file:

if device=xxx... fixtime=servertime
if devicetime>servertime... fixtime=servertime

these setting will overwrite fixtime variable everywhere or add these contitions at least before inserting position command.

Anton Tananaev8 years ago

There is no plan to add any conditional statements to the config. You would have to modify Java source. It should be fairly easy to implement what you want.