Skip to content

Commit

Permalink
Use gmtime instead of localtime and remove test
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardoRSeifert committed Nov 22, 2024
1 parent bf59f54 commit 280a45e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion parser/mpFuncCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 0 additions & 2 deletions tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 280a45e

Please sign in to comment.