#include #include #include //for the functions time and localtime using namespace std; int main() { //Get the day of the week (0 to 6 inclusive, 0 means Sunday) time_t t {time(nullptr)}; tm *p {localtime(&t)}; int weekday {p->tm_wday}; //and the current hour of the day (0 to 23 inclusive). int hour {p->tm_hour}; if (weekday == 4) { //if today is a Thursday if (hour == 12 + 6) { //if it's 6:00 p.m. cout << "It's your favorite time of the week!\n"; } } return EXIT_SUCCESS; }