Bug 246393 - QDateTime::fromString() calculate wrong day
QDateTime::fromString() calculate wrong day
Product: Fedora
Classification: Fedora
Component: qt (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Ngo Than
Fedora Extras Quality Assurance
: Patch
Depends On:
Blocks: 246024
  Show dependency treegraph
Reported: 2007-07-01 13:44 EDT by Jochen Schmitt
Modified: 2008-05-14 11:42 EDT (History)
4 users (show)

See Also:
Fixed In Version: 3.3.8b-1.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-05-14 11:42:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Bug-fix (541 bytes, patch)
2007-07-22 08:19 EDT, Robert de Vries
no flags Details | Diff

  None (edit)
Description Jochen Schmitt 2007-07-01 13:44:13 EDT
QDateTime::fromString() calculates wrong day when the day is more than 1 digit.

Can be reproduced with the following:

#include <qapplication.h>
#include <qdatetime.h>

int main(int argc, char *argv[])
    QApplication app(argc, argv);
    QDateTime time;
    time = time.fromString("Sat Mar 12 2007");

    qDebug("%d day", time.date().day());
    qDebug("%d month", time.date().month());
    qDebug("%d year", time.date().year());
    return 0;

This issue caused bug #24604 and is register in TrollTechs
Task Trackage datebase as ID #154433
Comment 1 Kevin Kofler 2007-07-11 00:24:45 EDT
The issue this causes in CrossVC is actually bug #246024 (without the typo).
Cervisia has the same bug, probably for the same reason.
CrossVC is getting a workaround, but I think this should really be patched in 
the Qt package.
Comment 2 Jochen Schmitt 2007-07-11 11:09:57 EDT
The upstream of CrossVC has create a workaround patch. A prerelease version of
CrossVC-1.5-2 which contains this patch can be find on rawhide.
Comment 3 Kevin Kofler 2007-07-11 11:12:29 EDT
I know, but this is a Qt bug and should really be fixed in Qt. And 
unfortunately we can't count on Trolltech to fix this because Qt 3 has been 
discontinued on July 1st.

CrossVC is also most likely not the only application affected, Cervisia appears 
to be hit by this too, at least judging from the symptoms, and there may be 
Comment 4 Jochen Schmitt 2007-07-11 16:01:39 EDT
Your right, I have reference to the Prerelease of CrossVC-1.5.2, because it may
be helpful to create a patch to solve the issue on Qt.
Comment 5 Robert de Vries 2007-07-22 08:19:15 EDT
Created attachment 159741 [details]

This patch fixes the bug by calculating the correct offset in the date string
where the day is located.
Comment 6 Jochen Schmitt 2007-07-22 16:22:05 EDT
I have tested the suggested bug fix.

It seems to works fine together with crossvc.
Comment 7 Jochen Schmitt 2007-08-07 15:55:41 EDT
Question: When we can expect the updated package?
Comment 8 Kevin Kofler 2007-10-05 17:42:44 EDT
Ping? Can we please get this fixed? While current CrossVC has a workaround, I 
believe this exact same Qt regression to also plague Cervisia (I see the same 
annoying symptoms as bug #246024 in Cervisia, and I haven't seen this with 
older Qt versions) and who knows what other programs are affected by this bug. 
A patch was provided 2.5 months ago. Than, can you please apply the patch?
Comment 9 Rex Dieter 2007-10-05 18:12:12 EDT
Anybody contact Trolltech about this (yet)?  If not, would be a good idea:
Comment 10 Kevin Kofler 2007-10-05 18:15:18 EDT
They have, as the bug report says: "is register in TrollTechs Task Trackage 
datebase as ID #154433". But this is Qt 3 and TrollTech isn't updating that 
anymore. I believe this bug is only in 3.3.8, older 3.3.x releases didn't have 
it, and Qt 4 probably doesn't either.
Comment 11 Kevin Kofler 2007-10-05 18:17:32 EDT
Upstream link (marked "won't fix"): 
Comment 12 Rex Dieter 2007-10-05 18:29:10 EDT
Fair 'nuf, maybe we can get into qt-copy then.
Comment 13 Bug Zapper 2008-05-14 09:22:26 EDT
This message is a reminder that Fedora 7 is nearing the end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 7. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '7'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 7's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 7 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug. If you are unable to change the version, please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. If possible, it is recommended that you try the newest available Fedora distribution to see if your bug still exists.

Please read the Release Notes for the newest Fedora distribution to make sure it will meet your needs:

The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 14 Kevin Kofler 2008-05-14 11:42:28 EDT
Fixed months ago actually, in 3.3.8b.

Note You need to log in before you can comment on or make changes to this bug.