[UNIX][C] Getdate
Fermé
beldyn
Messages postés
188
Date d'inscription
jeudi 28 novembre 2002
Statut
Membre
Dernière intervention
1 février 2005
-
8 août 2003 à 09:44
beldyn Messages postés 188 Date d'inscription jeudi 28 novembre 2002 Statut Membre Dernière intervention 1 février 2005 - 8 août 2003 à 10:27
beldyn Messages postés 188 Date d'inscription jeudi 28 novembre 2002 Statut Membre Dernière intervention 1 février 2005 - 8 août 2003 à 10:27
A voir également:
- [UNIX][C] Getdate
- Unix iso ✓ - Forum Linux / Unix
- Unix substring ✓ - Forum Shell
- Telecharger unix - Forum Linux / Unix
- Windows unix usb cle formatage - Guide
- Format unix ✓ - Forum Linux / Unix
1 réponse
Comme d ahb j y connais pas grand chose en UNIX mais VIVE GOOGLE!
ce bout de code devrait t aider:
ce bout de code devrait t aider:
struct date d; struct time t; if ((ficlog = fopen(FICLOG, "a+")) == NULL) { printf("erreur : impossible de creer le fichier %s\n\n",FICLOG); return 0; } getdate(&d); gettime(&t); fprintf(ficlog,"*******************************************\n"); fprintf(ficlog,"** **\n"); fprintf(ficlog,"** CHARGEMENT DE LA STATION **\n"); fprintf(ficlog,"** **\n"); fprintf(ficlog,"** %s **\n",STATION); fprintf(ficlog,"** **\n"); fprintf(ficlog,"** le %d/%d/%d **\n",d.da_day,d.da_mon,d.da_year); fprintf(ficlog,"** a %2dh %02dmin **\n",t.ti_hour, t.ti_min); fprintf(ficlog,"** **\n"); fprintf(ficlog,"** **\n"); fprintf(ficlog,"*******************************************\n\n");
8 août 2003 à 10:27
Par contre, j'ai trouvé ça:
struct tm DateE;
time_t timet;
time(&timet);
DateE= localtime(&timet);
printf("Le %02d/%02d/20%02d\n",DateE->tm_mday,DateE->tm_mon,DateE->tm_year);
Encore merci et à plus
Beldyn