fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. time_t Capture = time(0);
  7. char text[20];
  8. strftime(text, 20, "%d/%m/%Y %T", localtime(&Capture)); // 25/05/2020 12:51:00
  9. string Data_Hora(text);
  10. cout << Data_Hora;
  11. }
  12.  
  13. //https://pt.stackoverflow.com/q/453789/101
Success #stdin #stdout 0s 4400KB
stdin
Standard input is empty
stdout
25/05/2020 15:45:57