Advertisement
Garey

get current time

Oct 11th, 2017
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2. #include <chrono>
  3. #include <ctime>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.  
  9.     auto start = chrono::system_clock::now();
  10.     time_t current_time = chrono::system_clock::to_time_t(start);
  11.  
  12.     cout << ctime(&current_time);
  13.  
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement