+/*! \fn void formatdate(char *date,int date_size,int year,int month,int day,int hour,int minute,int second)
+Format a date to display it in the report.
+
+\param date The buffer to write the formatted date into.
+\param date_size The size of the buffer.
+\param year The absolute year to format. It must be greater than 1900.
+\param month The month to format. It must be between 1 and 12.
+\param day The day to format starting from 1.
+\param hour The hour to format.
+\param minute The minute to format.
+\param second The second to format.
+*/
+
+
+
+
+
/*! \fn void obtuser(const char *dirname, const char *name, char *tuser)
Get the number of entries stored in a connection data directory. The number is read from
the <tt>sarg-users</tt> file of the connection data's directory.
void strip_latin(char *line);
char *buildtime(long long int elap);
void obtdate(const char *dirname, const char *name, char *data);
+void formatdate(char *date,int date_size,int year,int month,int day,int hour,int minute,int second);
void obtuser(const char *dirname, const char *name, char *tuser);
void obttotal(const char *dirname, const char *name, char *tbytes, char *tuser, char *media);
void version(void);
obtuser(outdir,direntp->d_name,tuser);
obttotal(outdir,direntp->d_name,tbytes,tuser,media);
if (sscanf(data,"%d-%d-%d %d:%d:%d",&iyear,&imonth,&iday,&ihour,&iminute,&isecond)==6) {
+ formatdate(data,sizeof(data),iyear,imonth,iday,ihour,iminute,isecond);
fprintf(fp_tmp,"%04d%02d%02d%02d%02d%02d;%s;%s;%s;%s;%s;%s\n",iyear,imonth,iday,ihour,iminute,isecond, direntp->d_name, data, tuser, tbytes, media,newname);
} else {
/*
}
+void formatdate(char *date,int date_size,int year,int month,int day,int hour,int minute,int second)
+{
+ struct tm ltm;
+ time_t curtime;
+
+ memset(<m,0,sizeof(ltm));
+ ltm.tm_year=year-1900;
+ ltm.tm_mon=month-1;
+ ltm.tm_mday=day;
+ ltm.tm_hour=hour;
+ ltm.tm_min=minute;
+ ltm.tm_sec=second;
+ curtime=mktime(<m); //tm cannot be used directly because we need the date normalization made by mktime.
+ strftime(date,date_size,"%a %b %d %H:%M:%S %Z %Y",localtime(&curtime));
+}
+
+
void obtuser(const char *dirname, const char *name, char *tuser)
{