daily pastebin goal
30%
SHARE
TWEET

Untitled

a guest Mar 21st, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. string dateAString(time_t date)
  3. //conversion de seconde en date; fonction tiree de stackoverflow
  4. {
  5.     string date_en_lettres;
  6.     tm *ltm = localtime(&date);
  7.  
  8.     // print various components of tm structure.
  9.     date_en_lettres = to_string(ltm->tm_mday) + "/" + to_string(1 + ltm->tm_mon) + "/" + to_string(1900 + ltm->tm_year);
  10.    
  11.     return date_en_lettres;
  12. }
  13. elle est appelee de la maniere suivante:
  14.  
  15. base.clients[base.nombreDeClients - 1].clientDepuis = time(0); //ceci est de type time_t
  16.     date = dateAString(base.clients[base.nombreDeClients - 1].clientDepuis);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top