C++ examples for Data Type:time
Getting the Current Date and Time
#include <ctime> #include <chrono> #include <iostream> using namespace std; using namespace chrono; int main()//from w w w. jav a 2 s . c o m { auto currentTimePoint = system_clock::now(); auto currentTime = system_clock::to_time_t( currentTimePoint ); auto timeText = ctime( ¤tTime ); cout << timeText << endl; return 0; }