Go to the documentation of this file.
30 #define TM_WDAY_SUN (0)
31 #define TM_WDAY_MON (1)
32 #define TM_WDAY_TUE (2)
33 #define TM_WDAY_WED (3)
34 #define TM_WDAY_THU (4)
35 #define TM_WDAY_FRI (5)
36 #define TM_WDAY_SAT (6)
38 #define TM_MON_JAN ( 0)
39 #define TM_MON_FEB ( 1)
40 #define TM_MON_MAR ( 2)
41 #define TM_MON_APR ( 3)
42 #define TM_MON_MAY ( 4)
43 #define TM_MON_JUN ( 5)
44 #define TM_MON_JUL ( 6)
45 #define TM_MON_AUG ( 7)
46 #define TM_MON_SEP ( 8)
47 #define TM_MON_OCT ( 9)
48 #define TM_MON_NOV (10)
49 #define TM_MON_DEC (11)
55 extern const int8_t TM_MON_DAYS[12];
87 #ifndef ATMEGA_INCOMPATIBLE_TIME_H
88 void tm_get_wyday(
int year,
int mon,
int mday,
int *wday,
int *yday);
90 void tm_get_wyday(
int year,
int mon,
int mday, int8_t *wday, int16_t *yday);
Common macros and compiler attributes/pragmas configuration.
int tm_is_leap_year(unsigned year) CONST
Tells if a given year is a leap year in the Gregorian calendar.
const int16_t TM_MON_DAYS_ACCU[12]
The prefixsum of the number of days in common years.
int tm_is_valid_date(int year, int mon, int mday) CONST
Tests if a date is valid.
int tm_is_valid_time(int hour, int min, int sec) CONST
Shallow test if a time is valid.
void tm_fill_derived_values(struct tm *tm)
Fills in struct tm::tm_wday and struct tm::tm_yday given a date.
void tm_get_wyday(int year, int mon, int mday, int *wday, int *yday)
Calculates the day of the year and the weekday of a given date.
#define CONST
A function declared as CONST is PURE and also not allowed to examine global memory....
int tm_doomsday(int year) CONST
Returns the congruent weekday of the Doomsday (March 0).