Qt6: update to newer APIs for QDateTime

Fortunately, these were already available in Qt5.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2022-02-09 16:47:37 -08:00
parent 6f46238fc4
commit e29ecf2c9a
2 changed files with 6 additions and 6 deletions

View file

@ -753,9 +753,9 @@ timestamp_t dateTimeToTimestamp(const QDateTime &t)
QString render_seconds_to_string(int seconds)
{
if (seconds % 60 == 0)
return QDateTime::fromTime_t(seconds).toUTC().toString("h:mm");
return QDateTime::fromSecsSinceEpoch(seconds, Qt::UTC).toUTC().toString("h:mm");
else
return QDateTime::fromTime_t(seconds).toUTC().toString("h:mm:ss");
return QDateTime::fromSecsSinceEpoch(seconds, Qt::UTC).toUTC().toString("h:mm:ss");
}
int parseDurationToSeconds(const QString &text)