Created
December 16, 2022 14:20
-
-
Save NguyenTatNhac/0577827a92e0a33bc2052c3672312b27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool between(const struct time* begin, const struct time* examined, const struct time* end) { | |
int bSecond = begin->hour * 60 * 60 + begin->minute * 60 + begin->second; | |
int xSecond = examined->hour * 60 * 60 + examined->minute * 60 + examined->second; | |
int eSecond = end->hour * 60 * 60 + end->minute * 60 + end->second; | |
return xSecond >= bSecond && xSecond <= eSecond; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment