Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string dateAString(time_t date)
- //conversion de seconde en date; fonction tiree de stackoverflow
- {
- string date_en_lettres;
- tm *ltm = localtime(&date);
- // print various components of tm structure.
- date_en_lettres = to_string(ltm->tm_mday) + "/" + to_string(1 + ltm->tm_mon) + "/" + to_string(1900 + ltm->tm_year);
- return date_en_lettres;
- }
- elle est appelee de la maniere suivante:
- base.clients[base.nombreDeClients - 1].clientDepuis = time(0); //ceci est de type time_t
- date = dateAString(base.clients[base.nombreDeClients - 1].clientDepuis);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement