Skip to content

Commit

Permalink
localDateTimeFromUtc: Make argument a const reference and initialize …
Browse files Browse the repository at this point in the history
…QDateTime at construction
  • Loading branch information
JoergAtGithub committed Jun 10, 2024
1 parent 6d12418 commit 6d31001
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/util/datetime.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ namespace mixxx {

/// Obtain the local date time from an UTC date time.
inline QDateTime localDateTimeFromUtc(
QDateTime dt) {
dt.setTimeSpec(Qt::UTC);
return dt.toLocalTime();
const QDateTime& dt) {
return QDateTime(dt.date(), dt.time(), Qt::UTC).toLocalTime();
}

/// Extract a QDateTime from a QVariant.
Expand Down

0 comments on commit 6d31001

Please sign in to comment.