fix: timezone issue
This commit is contained in:
parent
ad7a6028b3
commit
27cec1d8cc
10 changed files with 27 additions and 28 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