add: weekly schedule support
This commit is contained in:
parent
b3f75f4004
commit
44a83cd2c5
11 changed files with 220 additions and 79 deletions
helpers
12
helpers/get_day_of_week.cc
Normal file
12
helpers/get_day_of_week.cc
Normal file
|
@ -0,0 +1,12 @@
|
|||
#include <netdb.h>
|
||||
#include <helpers.h>
|
||||
|
||||
int
|
||||
helpers::get_day_of_week()
|
||||
{
|
||||
time_t t = time(NULL);
|
||||
struct tm *now = localtime(&t);
|
||||
int wday_sun_sat = now->tm_wday;
|
||||
int wday_mon_sun = (wday_sun_sat + 6) % 7;
|
||||
return wday_mon_sun;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue