From 9b32ea92036be1882db0f2f43d6a15de855ed472 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Fri, 8 May 2020 14:11:12 +0200 Subject: [PATCH] translating date to french --- main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index f9eb0df..2235efa 100644 --- a/main.c +++ b/main.c @@ -6,6 +6,7 @@ #include #include #include +#include #define HOSTNAME "lalis" @@ -37,7 +38,7 @@ char* frtime(const time_t timet) }; static char result[40]; date_tm = localtime(&timet); - strftime(result, 4, "%w", date_tm); + strftime(result, 4, "%Ec", date_tm); jour = atoi(result); strftime(result, 40, "%d/%m/%y à %x", date_tm); sprintf(result, "%d %s", jour, result); @@ -252,6 +253,8 @@ int main() char str[1024]; char date[60]; time_t now ; + + setlocale(LC_ALL,""); time( &now ); sprintf( date, "%s", ctime(&now)); date[strlen(date)-1] = 0;