[mythtv] Date strings in Browse mode

Ben de Luca (bedel) bend at bedel.mine.nu
Tue May 11 18:50:47 EDT 2004


This started happening in the last few days, I planed to look at it 
when i had some time.

On 12/05/2004, at 5:46 AM, Bruce Markey wrote:

> 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
> 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;
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev



More information about the mythtv-dev mailing list