Keep the time-format tests passing when daylight saving ends (#17116)

(cherry picked from commit d1d8204dc1)
This commit is contained in:
SoftFever authored and SoftFever committed 2026-11-01 17:55:38 +08:00
1 parent ac5aa9c6c2
commit af2ffb8cdd
1 file changed
+5 -2
+5 -2
View File
@@ -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);