Excel reports using wrong time

kaykor7 years ago

The device times are local (android, ios, keelink), mySQL reports correct time(servertime, devicetime, and fixtime), web interface reports right time, logs report right time. But Excel reports UTC time, why?

Template: (default traccar)
${dateTool.format("YYYY-MM-dd HH:mm:ss", from, locale, timezone)+" - "+dateTool.format("YYYY-MM-dd HH:mm:ss", to, locale, timezone)}

timedatectl

  Local time: Wed 2017-10-11 15:34:16 EDT
  Universal time: Wed 2017-10-11 19:34:16 UTC
  RTC time: Wed 2017-10-11 19:34:17
  Time zone: America/Toronto (EDT, -0400)
  Network time on: yes
  NTP synchronized: no
  RTC in local TZ: no
gutitoni7 years ago

I have the same problem? solutions

Anton Tananaev7 years ago

Have you configured correct timezone in user settings?

gutitoni7 years ago

yes anton esta configurado america ciudad de mexico en el servidor .

Anton Tananaev7 years ago

English please.

visiondrive7 years ago

Gutitoni said he has configured the time zone to be Mexico City on the server.

I am unsure if he means his platform server time zone or the Traccar config for Server and or User

Gutitoni and Kaykor - did you update the time zone in SERVER - SERVER SETTINGS within TRACCAR? There is also a other time zone setting for each user too.

I have no setting for the USER but the SERVER is set to my time zone and the excel reports show correct times.

Anton Tananaev7 years ago

You need to have it configured in user or server settings in Traccar.

kaykor7 years ago

Corrected UTC to America/Toronto, thank you

I'm not a traveler who goes through different TZs
I guess I'm just having a hard time understanding the use case for this.
fixedtime will always show the device local chosen TZ.
The web interface shows the correct time even though I had inadvertently setup TZ as UTC.
Android and IOS will probably automatically update with whatever fixedtime the current device TZ is in, and I dont see a TZ in the logs

visiondrive7 years ago

Take Australia for example - we have three time zones and on top of that only some states use daylight savings. So we can have devices and clients working on the one server monitoring devices from the same or different time zones.

For myself I prefer UTC as there is never any confusion.

kaykor7 years ago

UTC is the best way for the server, but not the devices. One server can be used by many users in different timezones, currently UTC is the only option with manual conversion to local time. (Assuming users are using same login/resources) Setting up multiple users with multiple devices could be a pain.(Think of a national fleet of local trucks)
And for those who do not use UTC all the time conversion can be tricky and confusing, just like 24 hour time.

My thoughts with extremely limited usage/knowledge: Sorry Anton, cannot help myself.

Physical server UTC
Traccar Server UTC
Any other applications Traccar relies on UTC
Devices local TZ, or in the case of IOS, Android differing TZ as reported locally (actually I think it is a timestamp)

Don't attach time zone to server or user but the devices themself, I'm sure most if not all report time zones, or set it in device menu option.
Yes there would be a needed field added to table, web interface, reports but there would be more accuracy as the time reported for all devices would be the devices local time. In Canada and the US (Continental) there are six time zones. This doe not solve any isssues of travelling through TZ, to do that there would need to be a database with all map coordinates and differing TZ.

Use Case:
Head Office in Vancouver, offers delivery in southern Ontario through local shipping depot (Local Office closed at 4:30). Customer call at 1:45PM Pacific Time (Vancouver TZ) asking were the shipment is for Toronto location (EDS) 3 hours difference. This requires human calculation as their server is setup for PT TZ. Accident in St Johns Newfoundland, police notice GPS on truck and call head office to find the speed of the truck just before the accident on a city street, operator miss-calculates time difference forgetting Newfoundland has a half hour in its TZ gives wrong information of truck speed when it actually was on the highway.

Anton Tananaev7 years ago

Overwhelming majority of devices report UTC time and it's not configurable.

You example is relatively rare and involves interaction between two people in different timezones. It's always confusing and there is no way to avoid problems.

Most users want to see devices in their local timezone, even if devices are in different zones.