diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp index a5e9594ada..66522062bd 100644 --- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp @@ -4568,7 +4568,7 @@ static QDateTime findSpring(int year, const QTimeZone &timeZone) const QTimeZone::OffsetData transition = midSummer.isDaylightTime() ? timeZone.previousTransition(midSummer) : timeZone.nextTransition(midSummer); - const QDateTime spring = transition.atUtc.toLocalTime(); + const QDateTime spring = transition.atUtc.toTimeZone(timeZone); // there might have been DST at some point, but not in the year we care about if (spring.date().year() != year || !spring.isDaylightTime()) return QDateTime();