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

web engine always returns 0 for getTimezoneOffset()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.7.0
    • Fix Version/s: 5.7.1
    • Component/s: WebEngine
    • Labels:
      None
    • Environment:
      Arch Linux 64-bit

      Description

      The Date.getTimezoneOffset() function is broken in Qt WebEngine. It always returns 0, regardless of the actual time zone.

      Here is a script to demonstrate it:

      from PyQt5.Qt import (QApplication, QWebEngineView)                                                                                                                                                                                            
                                                                                                                             
      app = QApplication([])                                                                                                 
      w = QWebEngineView()                                                                                                   
      w.setHtml('<script>alert(new Date().getTimezoneOffset())</script>')                                                    
      w.show()                                                                                                               
                                                                                                                             
      app.exec_()
      

      This breaks time display on tons of websites.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              allan.jensen Allan Sandfeld Jensen
              Reporter:
              kovidgoyal Kovid Goyal
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes