avr-fw-modules/core/src/unix2datetime.c

19 lines
336 B
C
Executable File

#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;
};