Traccar web interface showed records in UTC timezone while I am in PST time zone. If I use export report function then excel generated will be in the local timezone. Android apps also show local timezone record.
I did some tests:
/opt/traccar/logs/tracker-server.log shows local time which is for me America/Los_Angeles
2021-09-18 17:50:12 INFO: [7d244441] id: owntracks/user/xqaq62, time: 2021-09-18 17:48:56, lat:
matching mysql record is in UTC time
| 11718 | owntracks | 3 | 2021-09-19 00:50:13 | 2021-09-19 00:48:56 | 2021-09-19 00:48:56 | 0x01 |
Server and device attributes timezone is America/Los_Angeles but changing either of those makes any difference.
/opt/traccar/conf/traccar.xml has this entry:
<entry key='database.url'>jdbc:mysql://localhost/traccar?serverTimezone=UTC&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
I tried to replace UTC with America/Los_Angeles but that added extra 7 hours so the web interface now has 14 hours difference with local time.
$timedatectl
Local time: Sun 2021-09-19 16:34:33 PDT
Universal time: Sun 2021-09-19 23:34:33 UTC
RTC time: Sun 2021-09-19 23:34:33
Time zone: America/Los_Angeles (PDT, -0700)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Then I tried MS Edge that showed correct time. Some googling brought this answer to my problem: in case you've set in Firefox privacy.resistFingerprinting to true in about:config, firefox will report ITC time to websites...
OK that was a pretty long journey to solve this time zone problem. However, I was unable to find what time zone attributes for device and server do. I would be grateful if someone could explain or point in the documentation the purpose of those settings.
Device timezone is needed in case your device is not reporting in UTC.
Server timezone is the same as user timezone, but for the whole server. It controls timezone for Excel reports.
Traccar web interface showed records in UTC timezone while I am in PST time zone. If I use export report function then excel generated will be in the local timezone. Android apps also show local timezone record.
I did some tests:
/opt/traccar/logs/tracker-server.log shows local time which is for me America/Los_Angeles
2021-09-18 17:50:12 INFO: [7d244441] id: owntracks/user/xqaq62, time: 2021-09-18 17:48:56, lat:
matching mysql record is in UTC time
| 11718 | owntracks | 3 | 2021-09-19 00:50:13 | 2021-09-19 00:48:56 | 2021-09-19 00:48:56 | 0x01 |
Server and device attributes timezone is America/Los_Angeles but changing either of those makes any difference.
/opt/traccar/conf/traccar.xml has this entry:
<entry key='database.url'>jdbc:mysql://localhost/traccar?serverTimezone=UTC&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
I tried to replace UTC with America/Los_Angeles but that added extra 7 hours so the web interface now has 14 hours difference with local time.
$timedatectl
Local time: Sun 2021-09-19 16:34:33 PDT
Universal time: Sun 2021-09-19 23:34:33 UTC
RTC time: Sun 2021-09-19 23:34:33
Time zone: America/Los_Angeles (PDT, -0700)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Then I tried MS Edge that showed correct time. Some googling brought this answer to my problem: in case you've set in Firefox privacy.resistFingerprinting to true in about:config, firefox will report ITC time to websites...
OK that was a pretty long journey to solve this time zone problem. However, I was unable to find what time zone attributes for device and server do. I would be grateful if someone could explain or point in the documentation the purpose of those settings.