Time in API calls one hour behind

Ólavur7 years ago

When I use the API I always get the time one hour behind:

events:

| 119562 | deviceStopped | 2017-05-01 08:16:05 |       50 |     886875 |       NULL | {}

positions:

| 886875 | ulbotech |       50 | 2017-05-01 08:16:05 | 2017-05-01 08:16:03 | 2017-05-01 08:16:03 | 

When I get trips from API:

/api/reports/trips?deviceId=50&from=2017-04-28T01:00:00.000Z&to=2017-05-01T16:00:00.000Z

I get this result:("endTime": "2017-05-01T07:16:03.000+0000")

{
    "deviceId": 50,
    "deviceName": "Heini - Audi A4",
    "distance": 35449,
    "averageSpeed": 43.64651843137257,
    "maxSpeed": 61.0151,
    "startPositionId": 886474,
    "endPositionId": 886875,
    "startLat": 62.19199,
    "startLon": -7.036808,
    "endLat": 62.03618,
    "endLon": -6.767145,
    "startTime": "2017-05-01T06:51:07.000+0000",
    "startAddress": "78 Streymnesvegur, Streymnes, Streymoyar sýsla, FO",
    "endTime": "2017-05-01T07:16:03.000+0000",
    "endAddress": "1 Klingran, Hoyvík, Streymoyar sýsla, FO",
    "duration": 1496000,
    "spentFuel": "-"
}

Does anyone know why this is happening?

Anton Tananaev7 years ago

Logic for calculating device stop notifications and trip reports is completely different.

Ólavur7 years ago

But still the tripsreport shows one hour less than the servertime.

Why is that? And can it be fixed?

Anton Tananaev7 years ago

You can try to adjust trip calculation parameters.

Ólavur7 years ago

This is the same problem when I call the API for positions. The API response always says one hour earlier than the record in the positions table.

Any idea?

Anton Tananaev7 years ago

Time in the trip report comes from positions table, so it can't be behind.