Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-73651

QGeoPositionInfo::timestamp() returns non UTC time on iOS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.11.3
    • Fix Version/s: 5.14.0 Alpha
    • Component/s: Positioning
    • Labels:
      None
    • Platform/s:
      iOS/tvOS/watchOS
    • Commits:
      b1e78d739752a044765776a59161809011875a5c (qt/qtlocation/dev)

      Description

      I tested on 5.11.3 but I see the problematic code is the same in 5.13 branch.

      Techinfo:
      Code in qgeopositioninfosource_cl.mm uses default constructor of QDateTime which has default Qt::LocalTime timespec default. Then it call setTime_t (followed by addMSecs).

      https://github.com/qt/qtlocation/blob/5.13/src/plugins/position/corelocation/qgeopositioninfosource_cl.mm#L72

      From the first look the best fix would be to call the following overload instead of setTime_t+addMSecs:

      static QDateTime QDateTime::fromMSecsSinceEpoch(qint64 msecs, Qt::TimeSpec spec, int offsetFromUtc = 0);

       

      And pass Qt::UTC timespec.

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            tpochep Timur Pocheptsov
            Reporter:
            xentrax Vyacheslav Lanovets
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes