[Kde-pim] KMail and KOrg incorrect time zone offset?
Sergio Martins
iamsergio at gmail.com
Sun May 11 16:00:14 BST 2014
On Saturday, May 10, 2014 09:57:45 John Layt wrote:
> Hi,
> If Plasma is showing the right time, then that suggests KTimeZone is
> reading the tz details right, and my initial thought was perhaps the
> RFC date formatting had a bug, but if his KOrg appointments are also
> wrong then that suggests something deeper. Any thoughts on how to
> debug?
Hi,
Looks like it's KTimeZone's fault.
#include <QDebug>
#include <KDateTime>
#include <ktzfiletimezone.h>
int main()
{
KTzfileTimeZoneSource source("/usr/share/zoneinfo/");
KTzfileTimeZone zone(&source, "Africa/Johannesburg");
KDateTime t(QDate(2013, 05, 10), QTime(13, 00), KDateTime::Spec(zone));
qDebug() << "Zone is valid?" << zone.isValid();
qDebug() << t.toString();
return 0;
}
This outputs:
Zone is valid? true
"2013-05-10T13:00:00+03:00"
Which is wrong, because Johannesburg is UTC+2, not +3.
Inspecting the tz file:
$ zdump -v Africa/Johannesburg
Africa/Johannesburg -9223372036854775808 = NULL
Africa/Johannesburg -9223372036854689408 = NULL
Africa/Johannesburg Sun Feb 7 22:07:59 1892 UT = Sun Feb 7 23:59:59 1892
LMT isdst=0 gmtoff=6720
Africa/Johannesburg Sun Feb 7 22:08:00 1892 UT = Sun Feb 7 23:38:00 1892
SAST isdst=0 gmtoff=5400
Africa/Johannesburg Sat Feb 28 22:29:59 1903 UT = Sat Feb 28 23:59:59 1903
SAST isdst=0 gmtoff=5400
Africa/Johannesburg Sat Feb 28 22:30:00 1903 UT = Sun Mar 1 00:30:00 1903
SAST isdst=0 gmtoff=7200
Africa/Johannesburg Sat Sep 19 23:59:59 1942 UT = Sun Sep 20 01:59:59 1942
SAST isdst=0 gmtoff=7200
Africa/Johannesburg Sun Sep 20 00:00:00 1942 UT = Sun Sep 20 03:00:00 1942
SAST isdst=1 gmtoff=10800
Africa/Johannesburg Sat Mar 20 22:59:59 1943 UT = Sun Mar 21 01:59:59 1943
SAST isdst=1 gmtoff=10800
Africa/Johannesburg Sat Mar 20 23:00:00 1943 UT = Sun Mar 21 01:00:00 1943
SAST isdst=0 gmtoff=7200
Africa/Johannesburg Sat Sep 18 23:59:59 1943 UT = Sun Sep 19 01:59:59 1943
SAST isdst=0 gmtoff=7200
Africa/Johannesburg Sun Sep 19 00:00:00 1943 UT = Sun Sep 19 03:00:00 1943
SAST isdst=1 gmtoff=10800
Africa/Johannesburg Sat Mar 18 22:59:59 1944 UT = Sun Mar 19 01:59:59 1944
SAST isdst=1 gmtoff=10800
Africa/Johannesburg Sat Mar 18 23:00:00 1944 UT = Sun Mar 19 01:00:00 1944
SAST isdst=0 gmtoff=7200
Africa/Johannesburg 9223372036854689407 = NULL
Africa/Johannesburg 9223372036854775807 = NULL
7200 is 2 hours, so looks correct.
Maybe David Jarvie has a clue..
Regards,
Sérgio Martins
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list