#include <time.h>
#include <stdlib.h>
Go to the source code of this file.
◆ _DAYS_IN_MONTH
#define _DAYS_IN_MONTH |
( |
|
x | ) |
((x == 1) ? days_in_feb : DAYS_IN_MONTH[x]) |
◆ _DAYS_IN_YEAR
#define _DAYS_IN_YEAR |
( |
|
year | ) |
(_ISLEAP(year) ? 366 : 365) |
◆ _ISLEAP
#define _ISLEAP |
( |
|
y | ) |
(((y) % 4) == 0 && (((y) % 100) != 0 || (((y)+1900) % 400) == 0)) |
◆ _SEC_IN_DAY
#define _SEC_IN_DAY 86400L |
◆ _SEC_IN_HOUR
#define _SEC_IN_HOUR 3600L |
◆ _SEC_IN_MINUTE
#define _SEC_IN_MINUTE 60L |
As there is no timegm()
function neither in newlib nor in POSIX, we add one here (based on a simplified newlib mktime()
).
It is used in Chan FatFS to convert dates fields.
Definition at line 45 of file timegm.c.
◆ timegm()
time_t timegm |
( |
struct tm * |
tim_p | ) |
|
◆ validate_structure()
static void validate_structure |
( |
struct tm * |
tim_p | ) |
|
|
static |
◆ _DAYS_BEFORE_MONTH
const int _DAYS_BEFORE_MONTH[12] |
|
static |
Initial value:=
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }
Definition at line 54 of file timegm.c.
◆ DAYS_IN_MONTH
const int DAYS_IN_MONTH[12] |
|
static |
Initial value:=
{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
Definition at line 49 of file timegm.c.