forked from haraldwolff/avr-fw-modules
19 lines
336 B
C
19 lines
336 B
C
|
#include <sys/time.h>
|
||
|
#include <sys/errno.h>
|
||
|
|
||
|
int unix2datetime(time_t unix,datetime_t* datetime){
|
||
|
if (datetime){
|
||
|
|
||
|
datetime->second = unix % 60;
|
||
|
unix /= 60;
|
||
|
datetime->minute = unix % 60;
|
||
|
unix /= 60;
|
||
|
datetime->hour = unix % 24;
|
||
|
unix /= 24;
|
||
|
|
||
|
/* TODO: Ewiger Kalender... */
|
||
|
|
||
|
return ESUCCESS;
|
||
|
};
|
||
|
return ENULLPTR;
|
||
|
};
|