Skip to content

Commit

Permalink
Workaround QT ISO date parsing issue in mythfilldatabase. Fixes #11538
Browse files Browse the repository at this point in the history
Signed-off-by: Stuart Morgan <smorgan@mythtv.org>
  • Loading branch information
Richard Begg authored and stuartm committed Jun 4, 2013
1 parent 2d61fd8 commit e60495b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mythtv/programs/mythfilldatabase/xmltvparser.cpp
Expand Up @@ -181,7 +181,11 @@ static void fromXMLTVDate(QString &timestr, QDateTime &dt)
// While this seems like a hack, it's better than what was done before
QString isoDateString = QString("%1 %2").arg(tmpDT.toString(Qt::ISODate))
.arg(tmp);
dt = QDateTime::fromString(isoDateString, Qt::ISODate).toUTC();
// Work around Qt bug where zero offset dates are flagged as LocalTime
tmpDT = QDateTime::fromString(isoDateString, Qt::ISODate);
if (tmpDT.timeSpec() == Qt::LocalTime)
tmpDT.setTimeSpec(Qt::UTC);
dt = tmpDT.toUTC();
}

if (!dt.isValid())
Expand Down

0 comments on commit e60495b

Please sign in to comment.