|
Open Garden
0.10.1-21
|
standard libc time handling functions, reduced and adapted to atmega project. More...
#include "rtc.h"

Go to the source code of this file.
Data Structures | |
| struct | tm |
Macros | |
| #define | LEAP_YEAR(year) ((year%4)==0) |
Typedefs | |
| typedef unsigned long | time_t |
Functions | |
| void | settimeofday (const time_t seconds) |
| time_t | gettimeofday (void) |
| time_t | time (time_t *t) |
| struct tm * | gmtime (time_t *timep) |
| time_t | mktime (struct tm *timeptr) |
| char * | asctime (struct tm *timeptr) |
| char * | ctime (time_t *timep) |
standard libc time handling functions, reduced and adapted to atmega project.
| #define LEAP_YEAR | ( | year | ) | ((year%4)==0) |
A leap year is ((((year%4)==0) && ((year%100)!=0)) || ((year%400)==0)) but since we have no fancy years between 1970 and 2038 we can do:
| typedef unsigned long time_t |
seconds since the epoch
| char* asctime | ( | struct tm * | timeptr | ) |
format the time into "Sat Feb 17 17:45:23 2001\n"
| char* ctime | ( | time_t * | timep | ) |
C lib ctime
| time_t gettimeofday | ( | void | ) |
C lib gettimeofday
convert calendar time (seconds since 1970) to broken-time.
This only works for dates between 01-01-1970 00:00:00 and 19-01-2038 03:14:07
| void settimeofday | ( | const time_t | seconds | ) |
C lib settimeofday
1.8.13