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

web engine always returns 0 for getTimezoneOffset()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.7.1
    • 5.7.0
    • WebEngine
    • None
    • Arch Linux 64-bit

      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.

        For Gerrit Dashboard: QTBUG-55125
        # Subject Branch Project Status CR V

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes