diff --git a/src/ui/util/dateutil.cpp b/src/ui/util/dateutil.cpp index bb0d2dbe..8de91ea3 100644 --- a/src/ui/util/dateutil.cpp +++ b/src/ui/util/dateutil.cpp @@ -29,7 +29,7 @@ qint32 DateUtil::getUnixHour(qint64 unixTime) qint32 DateUtil::getUnixDay(qint64 unixTime) { const QDate date = QDateTime::fromSecsSinceEpoch(unixTime).date(); - const QDateTime dateTime = QDateTime(date, QTime(0, 0), Qt::UTC); + const QDateTime dateTime = date.startOfDay(Qt::UTC); return getUnixHour(dateTime.toSecsSinceEpoch()); } @@ -42,7 +42,7 @@ qint32 DateUtil::getUnixMonth(qint64 unixTime, int monthStart) } const QDate dateMonth = QDate(date.year(), date.month(), 1); - const QDateTime dateTime = QDateTime(dateMonth, QTime(0, 0), Qt::UTC); + const QDateTime dateTime = dateMonth.startOfDay(Qt::UTC); return getUnixHour(dateTime.toSecsSinceEpoch()); }