CalcDST Function Test
This page tests the daylight saving time code.
bool Function CalcDST(int month, int day, int hour, int dow);
where month, day, hour are current date and time and dow is day of the week (Sunday = 0, Monday = 1, ... Saturday = 6).
The function returns true if the passed in date/time is daylight savings time, and false if not.
The test code calls CalcDST() with different values and the return value is checked to see if it is correct.
Test 7:
month Nov
day 1 to 7
dow 0 to 6
hour 1 to 3
Nov 1, Sun 01:00 DST = on
Nov 1, Sun 02:00 DST = off
Nov 1, Sun 03:00 DST = off
Nov 1, Mon 01:00 DST = on
Nov 1, Mon 02:00 DST = on
Nov 1, Mon 03:00 DST = on
Nov 1, Tue 01:00 DST = on
Nov 1, Tue 02:00 DST = on
Nov 1, Tue 03:00 DST = on
Nov 1, Wed 01:00 DST = on
Nov 1, Wed 02:00 DST = on
Nov 1, Wed 03:00 DST = on
Nov 1, Thu 01:00 DST = on
Nov 1, Thu 02:00 DST = on
Nov 1, Thu 03:00 DST = on
Nov 1, Fri 01:00 DST = on
Nov 1, Fri 02:00 DST = on
Nov 1, Fri 03:00 DST = on
Nov 1, Sat 01:00 DST = on
Nov 1, Sat 02:00 DST = on
Nov 1, Sat 03:00 DST = on
Nov 2, Sun 01:00 DST = on
Nov 2, Sun 02:00 DST = off
Nov 2, Sun 03:00 DST = off
Nov 2, Mon 01:00 DST = off
Nov 2, Mon 02:00 DST = off
Nov 2, Mon 03:00 DST = off
Nov 2, Tue 01:00 DST = on
Nov 2, Tue 02:00 DST = on
Nov 2, Tue 03:00 DST = on
Nov 2, Wed 01:00 DST = on
Nov 2, Wed 02:00 DST = on
Nov 2, Wed 03:00 DST = on
Nov 2, Thu 01:00 DST = on
Nov 2, Thu 02:00 DST = on
Nov 2, Thu 03:00 DST = on
Nov 2, Fri 01:00 DST = on
Nov 2, Fri 02:00 DST = on
Nov 2, Fri 03:00 DST = on
Nov 2, Sat 01:00 DST = on
Nov 2, Sat 02:00 DST = on
Nov 2, Sat 03:00 DST = on
Nov 3, Sun 01:00 DST = on
Nov 3, Sun 02:00 DST = off
Nov 3, Sun 03:00 DST = off
Nov 3, Mon 01:00 DST = off
Nov 3, Mon 02:00 DST = off
Nov 3, Mon 03:00 DST = off
Nov 3, Tue 01:00 DST = off
Nov 3, Tue 02:00 DST = off
Nov 3, Tue 03:00 DST = off
Nov 3, Wed 01:00 DST = on
Nov 3, Wed 02:00 DST = on
Nov 3, Wed 03:00 DST = on
Nov 3, Thu 01:00 DST = on
Nov 3, Thu 02:00 DST = on
Nov 3, Thu 03:00 DST = on
Nov 3, Fri 01:00 DST = on
Nov 3, Fri 02:00 DST = on
Nov 3, Fri 03:00 DST = on
Nov 3, Sat 01:00 DST = on
Nov 3, Sat 02:00 DST = on
Nov 3, Sat 03:00 DST = on
Nov 4, Sun 01:00 DST = on
Nov 4, Sun 02:00 DST = off
Nov 4, Sun 03:00 DST = off
Nov 4, Mon 01:00 DST = off
Nov 4, Mon 02:00 DST = off
Nov 4, Mon 03:00 DST = off
Nov 4, Tue 01:00 DST = off
Nov 4, Tue 02:00 DST = off
Nov 4, Tue 03:00 DST = off
Nov 4, Wed 01:00 DST = off
Nov 4, Wed 02:00 DST = off
Nov 4, Wed 03:00 DST = off
Nov 4, Thu 01:00 DST = on
Nov 4, Thu 02:00 DST = on
Nov 4, Thu 03:00 DST = on
Nov 4, Fri 01:00 DST = on
Nov 4, Fri 02:00 DST = on
Nov 4, Fri 03:00 DST = on
Nov 4, Sat 01:00 DST = on
Nov 4, Sat 02:00 DST = on
Nov 4, Sat 03:00 DST = on
Nov 5, Sun 01:00 DST = on
Nov 5, Sun 02:00 DST = off
Nov 5, Sun 03:00 DST = off
Nov 5, Mon 01:00 DST = off
Nov 5, Mon 02:00 DST = off
Nov 5, Mon 03:00 DST = off
Nov 5, Tue 01:00 DST = off
Nov 5, Tue 02:00 DST = off
Nov 5, Tue 03:00 DST = off
Nov 5, Wed 01:00 DST = off
Nov 5, Wed 02:00 DST = off
Nov 5, Wed 03:00 DST = off
Nov 5, Thu 01:00 DST = off
Nov 5, Thu 02:00 DST = off
Nov 5, Thu 03:00 DST = off
Nov 5, Fri 01:00 DST = on
Nov 5, Fri 02:00 DST = on
Nov 5, Fri 03:00 DST = on
Nov 5, Sat 01:00 DST = on
Nov 5, Sat 02:00 DST = on
Nov 5, Sat 03:00 DST = on
Nov 6, Sun 01:00 DST = on
Nov 6, Sun 02:00 DST = off
Nov 6, Sun 03:00 DST = off
Nov 6, Mon 01:00 DST = off
Nov 6, Mon 02:00 DST = off
Nov 6, Mon 03:00 DST = off
Nov 6, Tue 01:00 DST = off
Nov 6, Tue 02:00 DST = off
Nov 6, Tue 03:00 DST = off
Nov 6, Wed 01:00 DST = off
Nov 6, Wed 02:00 DST = off
Nov 6, Wed 03:00 DST = off
Nov 6, Thu 01:00 DST = off
Nov 6, Thu 02:00 DST = off
Nov 6, Thu 03:00 DST = off
Nov 6, Fri 01:00 DST = off
Nov 6, Fri 02:00 DST = off
Nov 6, Fri 03:00 DST = off
Nov 6, Sat 01:00 DST = on
Nov 6, Sat 02:00 DST = on
Nov 6, Sat 03:00 DST = on
Nov 7, Sun 01:00 DST = on
Nov 7, Sun 02:00 DST = off
Nov 7, Sun 03:00 DST = off
Nov 7, Mon 01:00 DST = off
Nov 7, Mon 02:00 DST = off
Nov 7, Mon 03:00 DST = off
Nov 7, Tue 01:00 DST = off
Nov 7, Tue 02:00 DST = off
Nov 7, Tue 03:00 DST = off
Nov 7, Wed 01:00 DST = off
Nov 7, Wed 02:00 DST = off
Nov 7, Wed 03:00 DST = off
Nov 7, Thu 01:00 DST = off
Nov 7, Thu 02:00 DST = off
Nov 7, Thu 03:00 DST = off
Nov 7, Fri 01:00 DST = off
Nov 7, Fri 02:00 DST = off
Nov 7, Fri 03:00 DST = off
Nov 7, Sat 01:00 DST = off
Nov 7, Sat 02:00 DST = off
Nov 7, Sat 03:00 DST = off