Skip to content
Commit 2fafabbf authored by Laurent Montel's avatar Laurent Montel
Browse files

Apply patch from Matt Whitlock + add autotest to validate it

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

BUG: 308444
BUG: 355195
BUG: 366768
parent bc77544a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment