From af2ffb8cddd2f3c0bdadc56d9cc3945fb23577ea Mon Sep 17 00:00:00 2001 From: SoftFever <103989404+SoftFever@users.noreply.github.com> Date: Sun, 1 Nov 2026 17:54:09 +0800 Subject: [PATCH] Keep the time-format tests passing when daylight saving ends (#17116) (cherry picked from commit d1d8204dc10ede60cbc25adcc7cdf3ec87a6f6ff) --- tests/libslic3r/test_timeutils.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/libslic3r/test_timeutils.cpp b/tests/libslic3r/test_timeutils.cpp index 9550740fa8..26f682596b 100644 --- a/tests/libslic3r/test_timeutils.cpp +++ b/tests/libslic3r/test_timeutils.cpp @@ -11,8 +11,11 @@ static void test_time_fmt(Slic3r::Utils::TimeFormat fmt) { using namespace Slic3r::Utils; - time_t t = get_current_time_utc(); - + // A fixed mid-year time (2019-07-10 08:50:00 UTC) rather than the current one: local + // time text can't tell apart the hour that repeats when daylight saving ends, so the + // local round trip would fail during that hour. + time_t t = 1562748600; + std::string tstr = time2str(t, TimeZone::local, fmt); time_t parsedtime = str2time(tstr, TimeZone::local, fmt); REQUIRE(t == parsedtime);