time.h(3avr)
π NAME π
bestie, welcome to time.h β the AVR-LibC header where all the time, date, calendar and even sky math lives. yes, sky math. she does it all. π°οΈβ¨
β¨ SYNOPSIS β¨
okay so here's the whole cast list, no skips, no skimming, we're reading all of it together π«Ά
π Data Structures
struct tm
struct week_date
two structs. two icons. π
π Macros
#define ONE_HOUR 3600
#define ONE_DEGREE 3600
#define ONE_DAY 86400
#define UNIX_OFFSET 946684800
#define NTP_OFFSET 3155673600
these are the little numbers that make everything else work, and yes they are exactly what they look like, copy them character for character pls π
π Typedefs
typedef uint32_t time_t
time_t is literally just a uint32_t wearing a cute little name tag. slay.
π Enumerations
enum _WEEK_DAYS_ { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY }
enum _MONTHS_ { JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER }
seven days, twelve months, all in order, all accounted for. the way that <pink>_WEEK_DAYS_</pink> and <pink>_MONTHS_</pink> understood the assignment ππ
π Functions
here's the entire friend group, in the exact order they showed up π
time_t time (time_t *timer)
int32_t difftime (time_t time1, time_t time0)
time_t mktime (struct tm *timeptr)
time_t mk_gmtime (const struct tm *timeptr)
struct tm * gmtime (const time_t *timer)
void gmtime_r (const time_t *timer, struct tm *timeptr)
struct tm * localtime (const time_t *timer)
void localtime_r (const time_t *timer, struct tm *timeptr)
char * asctime (const struct tm *timeptr)
void asctime_r (const struct tm *timeptr, char *buf)
char * ctime (const time_t *timer)
void ctime_r (const time_t *timer, char *buf)
char * isotime (const struct tm *tmptr)
void isotime_r (const struct tm *, char *)
size_t strftime (char *s, size_t maxsize, const char *format, const struct tm *timeptr)
void set_dst (int(*)(const time_t *, int32_t *))
void set_zone (int32_t)
void set_system_time (time_t timestamp)
void system_tick (void)
uint8_t is_leap_year (int16_t year)
uint8_t month_length (int16_t year, uint8_t month)
uint8_t week_of_year (const struct tm *timeptr, uint8_t start)
uint8_t week_of_month (const struct tm *timeptr, uint8_t start)
struct week_date * iso_week_date (int year, int yday)
void iso_week_date_r (int year, int yday, struct week_date *)
uint32_t fatfs_time (const struct tm *timeptr)
void set_position (int32_t latitude, int32_t longitude)
int16_t equation_of_time (const time_t *timer)
int32_t daylight_seconds (const time_t *timer)
time_t solar_noon (const time_t *timer)
time_t sun_rise (const time_t *timer)
time_t sun_set (const time_t *timer)
float solar_declinationf (const time_t *timer)
double solar_declination (const time_t *timer)
long double solar_declinationl (const time_t *timer)
int8_t moon_phase (const time_t *timer)
unsigned long gm_sidereal (const time_t *timer)
unsigned long lm_sidereal (const time_t *timer)
look at that list. clock stuff, calendar stuff, fatfs_time, set_position, sunrise and sunset, moon_phase, sidereal timeβ¦ she's not just a time header, she's a whole astronomy department π¦πβ
πΈ Author πΈ
Generated automatically by Doxygen for AVR-LibC from the source code.
not a human, not a bot with a name, just Doxygen doing her thing and generating docs for AVR-LibC straight from the source. automated queen behavior π
and that's the whole page, bestie!! π this was AVR-LibC Version 2.2.1, documented in time.h(3avr), and you read every single line of it. so proud of you. go compile something iconic with it πβ¨π¦π
π¦ where this page comes from
- debian trixie: avr-libc 1:2.2.1-1 Β· BSD-3-Clause
- ubuntu questing: avr-libc 1:2.2.1-1
- ubuntu resolute: avr-libc 1:2.2.1-1build1 Β· BSD-3-Clause
- ubuntu stonking: avr-libc 1:2.2.1-1build1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms