[mythtv] Date strings in Browse mode
Bruce Markey
bjm at lvcm.com
Tue May 11 15:46:04 EDT 2004
I rarely use Browse mode so I don't know when this problem
first appeared but I now see no descriptions but only a
message like "(-1440 minutes)".
I traced it down to a problem with converting a time string
back to Qt::ISODate. Neither the conversion to a string to
store in infoMap nor the conversion back to QDateTime has
changed in several months. Therefore, I assume that my Qt
version from debian has changed and is more strict about the
date format for conversion.
If I add a verbose message right before the conversion in
TV::GetNextProgram, mythfrontend shows the following when I
hit "O" for browse mode.
2004-05-11 12:13:25 Starttime 20040511121300
QTime::setHMS Invalid time 30:00:00.000
QDate::setYMD: Invalid date 2004-51-12
QDateTime::fromString: Parameter out of range
QTime::setHMS Invalid time 30:00:00.000
QDate::setYMD: Invalid date 2004-51-12
The docs say "If f is Qt::ISODate, the string format corresponds
to the ISO 8601 extended specification for representations of
dates and times, which is YYYY-MM-DDTHH:MM:SS" so it appears to
be parsing it like this:
20040511121300
YYYY-MM-DDTHH:MM:SS
2004-51-12?30:00:00
Browse mode has worked for me in the past. Has anyone else seen
this problem?
-- bjm
-------------- next part --------------
Index: libs/libmythtv/tv_play.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/tv_play.cpp,v
retrieving revision 1.176
diff -u -r1.176 tv_play.cpp
--- libs/libmythtv/tv_play.cpp 9 May 2004 06:29:07 -0000 1.176
+++ libs/libmythtv/tv_play.cpp 11 May 2004 19:25:15 -0000
@@ -2571,6 +2571,7 @@
QString tmFmt = gContext->GetSetting("TimeFormat");
QString dtFmt = gContext->GetSetting("ShortDateFormat");
+ VERBOSE(VB_GENERAL, QString("Starttime %1").arg(starttime));
QDateTime startts = QDateTime::fromString(starttime, Qt::ISODate);
QDateTime endts = QDateTime::fromString(endtime, Qt::ISODate);
QString length;
More information about the mythtv-dev
mailing list