add: weekly schedule support

This commit is contained in:
Tobias Reisinger 2020-04-23 17:00:12 +02:00
commit 44a83cd2c5
11 changed files with 219 additions and 78 deletions

View 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;
}