https://bugs.kde.org/show_bug.cgi?id=308444

Matt Whitlock <k...@mattwhitlock.name> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |k...@mattwhitlock.name

--- Comment #7 from Matt Whitlock <k...@mattwhitlock.name> ---
Created attachment 103342
  --> https://bugs.kde.org/attachment.cgi?id=103342&action=edit
Patch to messagelib that fixes the problem

QDateTime::time() returns a QTime, which conveys no time zone information.
QLocale::toString(const QTime &, QLocale::FormatType) then assumes that the
passed QTime is a local time. This causes a problem when processing a template
in that the time zone information of the Date header in the original message is
ignored, and the time part is then reinterpreted as a local time, which is
incorrect.

Example illustrating the problem:

        Original message header:
        Date: Sun, 1 Jan 2017 13:31:25 -0600

        %OTIMELONG in reply template expands to:
        1:31:25 PM EST

QLocale apparently offers no method to format a QTime with a specific
QTimeZone, so the best that can be done is to convert the QDateTime of the
original message into a local time by calling QDateTime::toLocalTime().

After applying this fix, the above example becomes:

        Original message header:
        Date: Sun, 1 Jan 2017 13:31:25 -0600

        %OTIMELONG in reply template expands to:
        2:31:25 PM EST

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to