char* timer_getcurDate(){
time_t rawtime; // variable for number of seconds (used with time() function)
struct tm *datetime; // variable for time in structure ->tm_mday, ->tm_sec, ...
char *temp = malloc(sizeof(char)*512);
if(temp){
time(&rawtime); // get time in seconds since 1/1/1970
datetime = localtime(&rawtime); // convert seconds in structure
// like sprintf, but only for date/time (Sunday-November-02-2003-15:12:52)
strftime(temp, sizeof(temp)-1, "%A, %B %d %Y %X", datetime);
return temp;
}
return NULL;
}