I\'m trying to convert a date string to a time_t, but mktime() is returning seemingly random dates:
time_t
string datetime = \"2014-12-10 10:30\"; stru
The below code would do the work, if you want current system time in an format
time_t current_time; struct tm *loctime; memset(buffer,0,strlen(buffer)); current_time = time(NULL); loctime = localtime(¤t_time); strftime(buffer,250,"--> %d/%m/%y %H:%M:%S",loctime);