]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Ported r167 from branches/v2_2_6_1 (several changes).
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Fri, 18 Dec 2009 13:45:28 +0000 (13:45 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Fri, 18 Dec 2009 13:45:28 +0000 (13:45 +0000)
Use LC_TIME to format the dates and times according to the selected locale.

17 files changed:
CMakeLists.txt
ChangeLog
configure
configure.in
documentation/util.txt
getconf.c
grepday.c
include/conf.h
include/config.h.in
include/defs.h
include/info.h
index.c
language.c
log.c
report.c
useragent.c
util.c

index e2291d04c42141fc3877dda68d0b448c91231c61..cce2a9881d5f1abacfa35541522a4516bfad1ed7 100755 (executable)
@@ -3,7 +3,7 @@ PROJECT(sarg C)
 SET(sarg_VERSION 2)
 SET(sarg_REVISION 2)
 SET(sarg_BUILD "7rc1")
-SET(sarg_BUILDDATE "Dec-10-2009")
+SET(sarg_BUILDDATE "Dec-18-2009")
 
 INCLUDE(AddFileDependencies)
 INCLUDE(CheckIncludeFile)
@@ -97,6 +97,7 @@ CHECK_INCLUDE_FILE(sys/wait.h HAVE_SYS_WAIT_H)
 CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
 CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
 CHECK_INCLUDE_FILE(limits.h HAVE_LIMITS_H)
+CHECK_INCLUDE_FILE(locale.h HAVE_LOCALE_H)
 
 CHECK_FUNCTION_EXISTS(bzero HAVE_BZERO)
 
@@ -108,10 +109,10 @@ IF(HAVE_GD_H)
    CHECK_INCLUDE_FILE(gdfonts.h HAVE_GDFONTS_H)
    CHECK_INCLUDE_FILE(gdfontmb.h HAVE_GDFONTMB_H)
    CHECK_INCLUDE_FILE(gdfontg.h HAVE_GDFONTG_H)
-   FIND_LIBRARY(GD_LIBRARY NAMES gd DOC "The GD library")
+   FIND_LIBRARY(GD_LIBRARY NAMES gd bgd DOC "The GD library")
    IF(GD_LIBRARY)
       #CHECK_LIBRARY_EXISTS(gd gdImagePng "." HAVE_GD)
-      TARGET_LINK_LIBRARIES(sarg gd)
+      TARGET_LINK_LIBRARIES(sarg ${GD_LIBRARY})
       SET(HAVE_GD GD_LIBRARY CACHE PATH DOC "True IF GD was found")
       SET(HAVE_GD CACHE BOOL DOC "True IF must use GD")
    ENDIF(GD_LIBRARY)
@@ -265,9 +266,9 @@ INSTALL(TARGETS sarg DESTINATION "${BINDIR}")
 INSTALL(FILES sarg.conf DESTINATION "${SYSCONFDIR}" RENAME sarg.conf.exemple)
 INSTALL(FILES exclude_codes user_limit_block css.tpl DESTINATION "${SYSCONFDIR}")
 INSTALL(FILES sarg.1 DESTINATION "${MANDIR}")
-INSTALL(DIRECTORY languages/ DESTINATION "${LANGDIR}" PATTERN "CVS" EXCLUDE)
-INSTALL(DIRECTORY images/ DESTINATION "${IMAGEDIR}" PATTERN "CVS" EXCLUDE)
-INSTALL(DIRECTORY fonts/ DESTINATION "${FONTDIR}" FILES_MATCHING PATTERN "*.ttf" PATTERN "CVS" EXCLUDE)
+INSTALL(DIRECTORY languages/ DESTINATION "${LANGDIR}" PATTERN ".svn" EXCLUDE)
+INSTALL(DIRECTORY images/ DESTINATION "${IMAGEDIR}" PATTERN ".svn" EXCLUDE)
+INSTALL(DIRECTORY fonts/ DESTINATION "${FONTDIR}" FILES_MATCHING PATTERN "*.ttf" PATTERN ".svn" EXCLUDE)
 
 # Package creation
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Squid Analysis Report Generator")
@@ -276,5 +277,5 @@ SET(CPACK_PACKAGE_VERSION_MINOR "${sarg_REVISION}")
 SET(CPACK_PACKAGE_VERSION_PATCH "${sarg_BUILD}")
 SET(CPACK_GENERATOR TGZ)
 SET(CPACK_SOURCE_GENERATOR TGZ)
-SET(CPACK_SOURCE_IGNORE_FILES "/CVS/" "/debian/" "/html/" "Makefile$" "config\\\\.log$" "config\\\\.status$" ".*~$" "\\\\.o$")
+SET(CPACK_SOURCE_IGNORE_FILES "/.svn/" "/debian/" "/html/" "Makefile$" "config\\\\.log$" "config\\\\.status$" ".*~$" "\\\\.o$")
 INCLUDE(CPack)
index 4c6bdc14b10ca0e2b37ad35daefbb2303c04ba03..b16d334d21187afc9a1fc8936a0d7c4af4f7a877 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13 +1,14 @@
 SARG ChangeLog
 
-Dec-15-2009 Version 2.2.7
+Dec-18-2009 Version 2.2.7
                - Extra compile and run time protection (FORTIFY_SOURCE) fixed in configure.
                - Use tabulations as columns separator in intermediary files to avoid problems when a field of the log contains a space.
                - Input log file type detection partly rewritten to clearly distinguish which type is processed where.
                - Read the input log file from standard input if log file name is -.
                - Use string pointers in getword instead of copying the strings over and over.
+               - Use LC_TIME to format some dates and times in the report according to the selected locale.
 
-Dec-14-2009 Version 2.2.6.1
+Dec-17-2009 Version 2.2.6.1
                - Remove unecessary dependency on off_t.
                - Configuration doesn't fail if rlim_t is not available.
                - Test for the availability of -Werror=implicit-function-declaration and -Werror=format flags in gcc (thanks to Murilo Moreira de Oliveira and pjetko).
@@ -18,6 +19,7 @@ Dec-14-2009 Version 2.2.6.1
                - Remove warnings if libgd is not available.
                - The date stored in sarg-date is now stored in a more machine readable form (thanks to rcastanheira for pointing this out).
                - The date read from sarg-date was not properly parsed and would produce a wrongly sorted index accross a year change (thanks to rcastanheira for pointing this out).
+               - my_mkdir changed to avoid the use of getword, be simpler and, maybe, work reliably on windows.
 
 Oct-14-2009 Version 2.2.6
                - Protection against buffer overflows in getword and friends and report the origin of the error instead of always blaming access.log.
index 9441291a86ded73958b670959d1a7fc43b366bda..817075170b82900d1459e2f548b85f2afa525b6e 100755 (executable)
--- a/configure
+++ b/configure
@@ -4769,12 +4769,13 @@ done
 
 
 
+
 
 
 for ac_header in stdio.h stdlib.h string.h strings.h sys/time.h time.h unistd.h sys/dirent.h \
                 dirent.h sys/socket.h netdb.h arpa/inet.h sys/types.h netinet/in.h sys/stat.h \
                 ctype.h gd.h gdfontl.h gdfontt.h gdfonts.h gdfontmb.h gdfontg.h iconv.h \
-                errno.h sys/resource.h sys/wait.h stdarg.h inttypes.h limits.h
+                errno.h sys/resource.h sys/wait.h stdarg.h inttypes.h limits.h locale.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -5518,7 +5519,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-FILE *f = fopen64 ("/tmp/foo","r");
+FILE *f = fopen64 ("/tmp/foo","r");fclose(f);
   ;
   return 0;
 }
index 7176328aca612261fdfd2eb395e934f7684e25fd..118ec8fa7727ac4e761f3c1c2525d9fe7c389a90 100644 (file)
@@ -65,7 +65,7 @@ fi
 AC_CHECK_HEADERS(stdio.h stdlib.h string.h strings.h sys/time.h time.h unistd.h sys/dirent.h \
                 dirent.h sys/socket.h netdb.h arpa/inet.h sys/types.h netinet/in.h sys/stat.h \
                 ctype.h gd.h gdfontl.h gdfontt.h gdfonts.h gdfontmb.h gdfontg.h iconv.h \
-                errno.h sys/resource.h sys/wait.h stdarg.h inttypes.h limits.h)
+                errno.h sys/resource.h sys/wait.h stdarg.h inttypes.h limits.h locale.h)
 
 AC_CHECK_LIB(gd, gdImagePng,LIBS="-lgd ${LIBS}"; HAVE_GD="yes", HAVE_GD="")
 
@@ -79,7 +79,7 @@ AC_SYS_LARGEFILE
 # needs to be defined for it
 AC_MSG_CHECKING([for fopen64])
 AC_CACHE_VAL(bu_cv_have_fopen64,
-[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[FILE *f = fopen64 ("/tmp/foo","r");]])],[bu_cv_have_fopen64=yes],[saved_CFLAGS=$CFLAGS
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[FILE *f = fopen64 ("/tmp/foo","r");fclose(f);]])],[bu_cv_have_fopen64=yes],[saved_CFLAGS=$CFLAGS
  CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
  AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
 bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE",
index 9de854b2fbeb60464f3a189e7dc33782c1c0676a..b52ee5d4dc49f0b7c893b80e180db15c0338415a 100644 (file)
@@ -349,7 +349,7 @@ bytes long.
 
 
 
-/*! \fn void formatdate(char *date,int date_size,int year,int month,int day,int hour,int minute,int second)
+/*! \fn void formatdate(char *date,int date_size,int year,int month,int day,int hour,int minute,int second,int dst)
 Format a date to display it in the report.
 
 \param date The buffer to write the formatted date into.
@@ -360,6 +360,7 @@ Format a date to display it in the report.
 \param hour The hour to format.
 \param minute The minute to format.
 \param second The second to format.
+\param dst A positive number if the daylight saving is active, zero if it is not active and a negative number if it is unknown.
 */
 
 
index 361e4e87208c72896eceb69e8f9c52381e3eabcf..63ae654d89e5d8e3bf56e3eaf4088ee2b4800476 100644 (file)
--- a/getconf.c
+++ b/getconf.c
@@ -1,6 +1,6 @@
 /*
  * AUTHOR: Pedro Lineu Orso                         pedro.orso@gmail.com
- *                                                            1998, 2008
+ *                                                            1998, 2009
  * SARG Squid Analysis Report Generator      http://sarg.sourceforge.net
  *
  * SARG donations:
index e200278b8798f8c79db9e2435bfac7db76a16211..9cd87deae28b9e52fbb36066da9ddab3c05770c5 100644 (file)
--- a/grepday.c
+++ b/grepday.c
@@ -1,6 +1,6 @@
 /*
  * AUTHOR: Pedro Lineu Orso                         pedro.orso@gmail.com
- *                                                            1998, 2008
+ *                                                            1998, 2009
  * SARG Squid Analysis Report Generator      http://sarg.sourceforge.net
  *
  * SARG donations:
@@ -26,7 +26,7 @@
 #include "include/conf.h"
 #include "include/defs.h"
 
-#if defined(HAVE_GD) && defined(HAVE_ICONV_H) && defined(gdFTEX_Unicode)
+#if defined(HAVE_GD)
 
 static int blue;
 static int white;
@@ -41,6 +41,7 @@ static int black;
 //static char *font1 = FONTDIR"/FreeSans.ttf";
 static char *font1 = FONTDIR"/DejaVuSans.ttf";
 
+#if defined(HAVE_ICONV_H) && defined(gdFTEX_Unicode)
 #include <iconv.h>
 #define SARGgdImageStringFT I18NgdImageStringFT
 
@@ -75,7 +76,6 @@ static char * I18NgdImageStringFT (gdImage * im, int *brect, int fg, char *fontl
 #define SARGgdImageStringFT gdImageStringFT
 #endif
 
-#ifdef HAVE_GD
 static void bar(int x1,long long int n)
 {
    gdPoint points[4];
@@ -229,7 +229,7 @@ static void bar(int x1,long long int n)
 
    return;
 }
-#endif
+#endif //HAVE_GD
 
 void greport_day(const char *user)
 {
@@ -482,7 +482,7 @@ void greport_day(const char *user)
    unlink(wdirname);
    unlink(tmp5);
 
-#endif
+#endif //HAVE_GD
 
    return;
 }
index 3f98b67d2ec87a98aad332d78d6ea60581861390..32fddc3b94529c75f81bb3bbc6ec59203f0780a3 100755 (executable)
@@ -94,6 +94,9 @@ gdPoint points[4];
 #ifdef HAVE_WINSOCK_H
 #include <winsock.h>
 #endif
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
 
 #if defined(HAVE_FOPEN64)
 #define _FILE_OFFSET_BITS 64
index bc502edbced0e8055e2caf4f885e7f022c75d798..b86399ca8a1d08013cf6e103477fe038c86eae8c 100644 (file)
@@ -40,6 +40,7 @@
 #cmakedefine HAVE_LIMITS_H
 #cmakedefine HAVE_WINDOWS_H
 #cmakedefine HAVE_WINSOCK_H
+#cmakedefine HAVE_LOCALE_H
 
 #cmakedefine IBERTY_LIB
 
index c9d54986a41f47a989cbe8cf021aff9ce7f41a8f..96afc89d81e067020e2a7e01cc952cc3bf767c66 100755 (executable)
@@ -153,7 +153,7 @@ void url_module(const char *url, char *w2);
 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 formatdate(char *date,int date_size,int year,int month,int day,int hour,int minute,int second,int dst);
 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);
index 166789489ac11c14f956e80ac94b252682b9d376..c26ef74f2ea23dcd966629dfe4160ca838d56f29 100755 (executable)
@@ -1,3 +1,3 @@
-#define VERSION PACKAGE_VERSION" Dec-10-2009"
+#define VERSION PACKAGE_VERSION" Dec-18-2009"
 #define PGM PACKAGE_NAME
 #define URL "http://sarg.sourceforge.net"
diff --git a/index.c b/index.c
index d8f9939a4417ba82ec3f181ebcb3824f6861b4f3..8e0277a92701e45bf7895348fdd7eafb4a66a322 100644 (file)
--- a/index.c
+++ b/index.c
@@ -55,6 +55,7 @@ void make_index(void)
    char d1[3], d2[3];
    char m1[4], m2[4];
    struct getwordstruct gwarea;
+   int iyear, imonth, iday, ihour, iminute, isecond, idst;
 
    if(LastLog[0] != '\0') mklastlog(outdir);
 
@@ -203,8 +204,8 @@ void make_index(void)
          obtdate(outdir,direntp->d_name,data);
          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);
+         if (sscanf(data,"%d-%d-%d %d:%d:%d %d",&iyear,&imonth,&iday,&ihour,&iminute,&isecond,&idst)==7) {
+            formatdate(data,sizeof(data),iyear,imonth,iday,ihour,iminute,isecond,idst);
             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 {
             /*
index e01ceacfa8b3d7f2ba001b73b0228283af9087af..0fee78a64b853027c01023595d923784cbbd3b88 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * AUTHOR: Pedro Lineu Orso                         pedro.orso@gmail.com
- *                                                            1998, 2008
+ *                                                            1998, 2009
  * SARG Squid Analysis Report Generator      http://sarg.sourceforge.net
  *
  * SARG donations:
@@ -48,6 +48,7 @@ void language_load(const char *language)
 
    while(record<sizeof(text)/sizeof(text[0]) && fgets(buf,sizeof(buf),fp_text)!=NULL) {
       if (buf[0] == '#') {
+         begin=buf;
          text[record][0] = '\0';
       } else {
          begin = strchr(buf,'\"');
diff --git a/log.c b/log.c
index 86d2000b626516a254261e9f3b91791fb01b2dca..268695e3116a8c4b9bd8f2ae7a251de981c4a954 100644 (file)
--- a/log.c
+++ b/log.c
@@ -290,6 +290,10 @@ int main(int argc,char *argv[])
    bzero(IncludeUsers, MAXLEN);
    bzero(ExcludeString, MAXLEN);
 
+#ifdef HAVE_LOCALE_H
+   setlocale(LC_TIME,"");
+#endif
+
    for(x=0; x<=254; x++)
       warq[x][0]='\0';
 
index 088e1b4fe99bfbbf7ddd9d0bbda4a09f8d7433da..555e6ee96b009755bcf062b3f368a13a59d0c45c 100644 (file)
--- a/report.c
+++ b/report.c
@@ -1,6 +1,6 @@
 /*
  * AUTHOR: Pedro Lineu Orso                         pedro.orso@gmail.com
- *                                                            1998, 2008
+ *                                                            1998, 2009
  * SARG Squid Analysis Report Generator      http://sarg.sourceforge.net
  *
  * SARG donations:
index 532b41d9c503200a4b1e8292f9c73ac324f43176..27e20626db23836f2b0b619a54e4804bc4540dc1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * AUTHOR: Pedro Lineu Orso                         pedro.orso@gmail.com
- *                                                            1998, 2008
+ *                                                            1998, 2009
  * SARG Squid Analysis Report Generator      http://sarg.sourceforge.net
  *
  * SARG donations:
diff --git a/util.c b/util.c
index edd2d922d41a7fae56b22ac3afca36b2f2334ff0..1a82b6b0c81f4abac0e4eec45d5d1ab8c3ba2350 100644 (file)
--- a/util.c
+++ b/util.c
@@ -205,10 +205,9 @@ static int is_absolute(const char *path)
 
 void my_mkdir(const char *name)
 {
-   char w0[255];
-   char w1[255];
-   char w2[255];
-   struct getwordstruct gwarea;
+   char w0[MAXLEN];
+   int i;
+   int chars;
 
    if(!is_absolute(name)) {
       fprintf(stderr,"SARG: Invalid path (%s). Please, use absolute paths only.\n",name);
@@ -216,32 +215,29 @@ void my_mkdir(const char *name)
       exit(1);
    }
 
-   strcpy(w0,name);
-   strcpy(w2,"/");
-   getword_start(&gwarea,w0);
-   if (getword_multisep(w1,sizeof(w1),&gwarea,'/')<0) {
-      printf("SARG: Maybe you have a broken record or garbage in the directory name %s.\n",name);
-      exit(1);
-   }
-   while(strchr(gwarea.current,'/')) {
-      if (getword_multisep(w1,sizeof(w1),&gwarea,'/')<0) {
-         printf("SARG: Maybe you have a broken record or garbage in the directory name %s.\n",name);
+   chars=0;
+   for (i=0 ; name[i] ; i++) {
+      if (i>=sizeof(w0)) {
+         fprintf(stderr,"SARG: directory name too long %s\n",name);
          exit(1);
       }
-      strcat(w2,w1);
-      if(access(w2, R_OK) != 0) {
-         if(mkdir(w2,0755)) {
-            fprintf(stderr,"SARG: mkdir %s %s\n",w2,strerror(errno));
-            fprintf(stderr,"SARG: process aborted.\n");
-            exit(1);
+      if (chars>0 && name[i] == '/') {
+         w0[i] = '\0';
+         if(access(w0, R_OK) != 0) {
+            if(mkdir(w0,0755)) {
+               fprintf(stderr,"SARG: mkdir %s %s\n",w0,strerror(errno));
+               fprintf(stderr,"SARG: process aborted.\n");
+               exit(1);
+            }
          }
       }
-      strcat(w2,"/");
+      if (name[i] != '/') chars++;
+      w0[i] = name[i];
    }
-   strcat(w2,gwarea.current);
-   if(access(w2, R_OK) != 0) {
-      if(mkdir(w2,0755)) {
-         fprintf(stderr,"SARG: mkdir %s %s\n",w2,strerror(errno));
+
+   if(access(name, R_OK) != 0) {
+      if(mkdir(name,0755)) {
+         fprintf(stderr,"SARG: mkdir %s %s\n",name,strerror(errno));
          fprintf(stderr,"SARG: process aborted.\n");
          exit(1);
       }
@@ -646,20 +642,20 @@ 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 formatdate(char *date,int date_size,int year,int month,int day,int hour,int minute,int second,int dst)
 {
    struct tm ltm;
-   time_t curtime;
 
    memset(&ltm,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(&ltm); //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));
+   if (year>=1900) ltm.tm_year=year-1900;
+   if (month>=1 && month<=12) ltm.tm_mon=month-1;
+   if (day>=1 && day<=31) ltm.tm_mday=day;
+   if (hour>=0 && hour<24) ltm.tm_hour=hour;
+   if (minute>=0 && minute<60) ltm.tm_min=minute;
+   if (second>=0 && second<60) ltm.tm_sec=second;
+   ltm.tm_isdst=dst;
+   //strftime(date,date_size,"%a %b %d %H:%M:%S %Z %Y",&ltm);
+   strftime(date,date_size,"%c",&ltm);
 }
 
 
@@ -786,6 +782,7 @@ void vrfydir(const char *dir, const char *per1, const char *addr, const char *si
    char d1[3], d2[3];
    char m1[4], m2[4];
    time_t curtime;
+   struct tm *loctm;
    int cstatus;
 
    if(strcmp(IndexTree,"date") == 0) {
@@ -932,8 +929,9 @@ void vrfydir(const char *dir, const char *per1, const char *addr, const char *si
    }
    time(&curtime);
    //strftime(wdir,sizeof(wdir),"%a %b %d %H:%M:%S %Z %Y",localtime(&curtime));
-   strftime(wdir,sizeof(wdir),"%Y-%m-%d %H:%M:%S",localtime(&curtime));
-   fprintf(fp_ou,"%s\n",wdir);
+   loctm=localtime(&curtime);
+   strftime(wdir,sizeof(wdir),"%Y-%m-%d %H:%M:%S",loctm);
+   fprintf(fp_ou,"%s %d\n",wdir,loctm->tm_isdst);
    fclose(fp_ou);
 
    strcpy(per2,IMAGEDIR);
@@ -1001,13 +999,15 @@ void zdate(char *ftime,int ftimesize, const char *DateFormat)
 
    t = time(NULL);
    local = localtime(&t);
+   /*
    if(strcmp(DateFormat,"u") == 0)
       strftime(ftime, ftimesize, "%b/%d/%Y %H:%M", local);
    if(strcmp(DateFormat,"e") == 0)
       strftime(ftime, ftimesize, "%d/%b/%Y-%H:%M", local);
    if(strcmp(DateFormat,"w") == 0)
       strftime(ftime, ftimesize, "%V-%H-%M", local);
-
+   */
+   strftime(ftime, ftimesize, "%x %X", local);
    return;
 }