Skip to content

Commit

Permalink
Fix for JoeStrout#159
Browse files Browse the repository at this point in the history
  • Loading branch information
marcgurevitx committed Jul 15, 2024
1 parent e85ec61 commit db98690
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions MiniScript-cpp/src/DateTimeUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ time_t ParseDate(const String dateStr) {
dateTime.tm_mon = now.tm_mon;
dateTime.tm_mday = now.tm_mday;
}
dateTime.tm_isdst = -1;
return mktime(&dateTime);
}

Expand Down
14 changes: 14 additions & 0 deletions MiniScript-cpp/tests/testDaylight.ms
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import "qa"

testDaylight = function

// This test always only tests a half of functionality depending on whether the host system has "daylight savings" on or off.

d = "2000-01-01 11:00:00"
qa.assertEqual _dateStr(d, "%H"), "11"

d = "2000-07-01 11:00:00"
qa.assertEqual _dateStr(d, "%H"), "11"
end function

if refEquals(locals, globals) then testDaylight

0 comments on commit db98690

Please sign in to comment.