From 280a45e8c710943911cbd9df8caf86fc1bc47ea0 Mon Sep 17 00:00:00 2001 From: Eduardo Rodrigues Seifert Date: Fri, 22 Nov 2024 16:05:35 -0300 Subject: [PATCH] Use gmtime instead of localtime and remove test --- parser/mpFuncCommon.cpp | 2 +- tests.sh | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/parser/mpFuncCommon.cpp b/parser/mpFuncCommon.cpp index c29be20..2f28f58 100644 --- a/parser/mpFuncCommon.cpp +++ b/parser/mpFuncCommon.cpp @@ -910,7 +910,7 @@ MUP_NAMESPACE_START } std::time_t t = std::time(0); - std::tm now = *std::localtime(&t); + std::tm now = *std::gmtime(&t); *ret = format_time(now, gmt_offset); } diff --git a/tests.sh b/tests.sh index c21fcdb..815d1c3 100755 --- a/tests.sh +++ b/tests.sh @@ -199,8 +199,6 @@ test_eval 'timediff("02:00:00", "03:30:00")' '1.5' test_eval 'timediff("03:30:00", "02:00:00")' '22.5' test_eval 'timediff("02:00:00", "02:00:30")' '0.01' -current_time=$(echo `date +"%H:%M:%S"`) -test_eval 'current_time()' "\"$current_time\"" test_eval 'current_time("2")' "Argument 1 of function/operator \"current_time\" is of type 's' whereas type 'i' was expected." # Mask tests