1
0

translating date to french

This commit is contained in:
Daniel Tartavel 2020-05-08 14:11:12 +02:00
parent fe708d2207
commit 9b32ea9203

5
main.c
View File

@ -6,6 +6,7 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <utmp.h>
#include <locale.h>
#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;