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

Give QDateTime's zone-specifier 't' less dumb behaviour on repetition.



    • Type: Task
    • Status: In Progress
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.6, 6.2
    • Fix Version/s: None
    • Component/s: Core: Date/Time
    • Labels:
    • Platform/s:
    • Story Points:
    • Sprint:
      Team 1 Foundation_Sprint 42, Team 1 Foundation_Sprint 43, Team 1 Foundation_Sprint 44, Team 1 Foundation_Sprint 45, Team 1 Foundation_Sprint 46, Foundation Next


      Various format specifiers use different lengths to encode different ways of representing a field – e.g. 'M' for month-number (unpadded), 'MM' for two-digit (zero-padded if needed) month number, 'MMM'} for abbreviated month name and 'MMMM' for full month name.

      The 't' format specifier is currently documented as

          \row \li t \li The timezone (for example "CEST")

      This (given the behaviour of the other fields, when more of a specifier are given than the recognised patterns) implies repeating the zone for 'tt' and longer forms, where we could give those meaning as different forms of the zone, e.g. full name (Europe/Oslo), short name (CEST), and offset suffix (+01:00).

      The parser currently does its best to recognise both full name and various offset suffix forms; the short name form is unparseable (due to collisions, as various zones are abbreviated identically). The present serialization's use of the short-form is, consequently, severely sub-optimal.

      (Also: when parsing, only QDateTime recognises 't' but, when serializing, QTime also accepts it, somewhat questionably using localtime's zone. This behaviour dates back at least to 5.2, when QLocale was made consistent with qdatetime.cpp, ready for changing the latter to delegate to the former.)

      Resolving this will be a significant behaviour change, but hopefully few users are currently relying on repetition of 't' to produce repeated zone specification.


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



            Eddy Edward Welbourne
            Eddy Edward Welbourne
            PM Owner:
            Vladimir Minenko Vladimir Minenko
            RnD Owner:
            Alex Blasche Alex Blasche
            0 Vote for this issue
            1 Start watching this issue



                Gerrit Reviews

                There are no open Gerrit changes