#include #include /***************************************** ********* Get data and time ************* ****** in format YYYY-MM-DD HH:MM:SS ****/ char *now (void) { static char data[20]; time_t tp; struct tm *lc; tp =time(NULL); lc = localtime(&tp); sprintf(data,"%04d-%02d-%02d %02d:%02d:%02d",lc->tm_year + 1900,lc->tm_mon + 1, lc->tm_mday, lc->tm_hour,lc->tm_min,lc->tm_sec); return data; }