add: commands
fix: timezone problem
This commit is contained in:
parent
0edb16a2d5
commit
10e41ca166
11 changed files with 209 additions and 21 deletions
|
@ -1,12 +0,0 @@
|
|||
#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;
|
||||
}
|
11
helpers/get_weekday.c
Normal file
11
helpers/get_weekday.c
Normal file
|
@ -0,0 +1,11 @@
|
|||
#include <time.h>
|
||||
|
||||
#include <helpers.h>
|
||||
|
||||
int
|
||||
helper_get_weekday(const struct tm *time_struct)
|
||||
{
|
||||
int wday_sun_sat = time_struct->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