13 lines
253 B
C
13 lines
253 B
C
|
#include <time.h>
|
||
|
|
||
|
#include <helpers.h>
|
||
|
|
||
|
int
|
||
|
helper_get_weekday(const time_t timestamp_now)
|
||
|
{
|
||
|
struct tm *now = localtime(×tamp_now);
|
||
|
int wday_sun_sat = now->tm_wday;
|
||
|
int wday_mon_sun = (wday_sun_sat + 6) % 7;
|
||
|
return wday_mon_sun;
|
||
|
}
|