Advertisement
Garey

rado time

Oct 11th, 2017
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     time_t _tm =time(NULL);
  9.     struct tm * curtime = localtime (&_tm);
  10.  
  11.     cout << "Day: " << curtime->tm_mday << " Month: " << curtime->tm_mon +1 << " Year: " << curtime->tm_year + 1900 << endl;
  12.     cout << "Hour: " << curtime->tm_hour << " Minutes: " << curtime->tm_min << " Seconds: " << curtime->tm_sec << endl;
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement