]> granicus.if.org Git - vnstat/commitdiff
replace asctime() with strftime()
authorTeemu Toivola <git@humdi.net>
Sat, 10 Mar 2018 23:23:05 +0000 (01:23 +0200)
committerTeemu Toivola <git@humdi.net>
Sat, 10 Mar 2018 23:23:05 +0000 (01:23 +0200)
src/dbshow.c

index 744e506611208e1ff89c4defc5c7f45aa8664529..4c969b4e2cb92d0199fa0488df597360729b6c57 100644 (file)
@@ -73,7 +73,8 @@ void showsummary(const interfaceinfo *interface, const int shortmode)
        e_rx=e_tx=0;
 
        if (interface->updated && !shortmode) {
-               printf("Database updated: %s\n",(char*)asctime(localtime(&interface->updated)));
+               strftime(datebuff, DATEBUFFLEN, "%Y-%m-%d %H:%M:%S", localtime(&interface->updated));
+               printf("Database updated: %s\n\n", datebuff);
        } else if (!shortmode) {
                printf("\n");
        }