mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
Fix timezone parsing in RSS (closes #136)
This commit is contained in:
parent
c6edf31480
commit
8758be5912
1 changed files with 8 additions and 7 deletions
|
@ -178,13 +178,14 @@ QDateTime RssParser::parseDate(const QString &string) {
|
||||||
QDate qdate(year, month+1, day); // convert date, and check for out-of-range
|
QDate qdate(year, month+1, day); // convert date, and check for out-of-range
|
||||||
if (!qdate.isValid())
|
if (!qdate.isValid())
|
||||||
return QDateTime::currentDateTime();
|
return QDateTime::currentDateTime();
|
||||||
QDateTime result(qdate, QTime(hour, minute, second));
|
QTime qTime(hour, minute, second);
|
||||||
if (!result.isValid()
|
|
||||||
|| (dayOfWeek >= 0 && result.date().dayOfWeek() != dayOfWeek+1))
|
QDateTime result(qdate, qTime, Qt::UTC);
|
||||||
return QDateTime::currentDateTime(); // invalid date/time, or weekday doesn't correspond with date
|
if (offset)
|
||||||
if (!offset) {
|
result = result.addSecs(-offset);
|
||||||
result.setTimeSpec(Qt::UTC);
|
if (!result.isValid())
|
||||||
}
|
return QDateTime::currentDateTime(); // invalid date/time
|
||||||
|
|
||||||
if (leapSecond) {
|
if (leapSecond) {
|
||||||
// Validate a leap second time. Leap seconds are inserted after 23:59:59 UTC.
|
// Validate a leap second time. Leap seconds are inserted after 23:59:59 UTC.
|
||||||
// Convert the time to UTC and check that it is 00:00:00.
|
// Convert the time to UTC and check that it is 00:00:00.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue