char* ctime(const time_t* kqpTime);
#include <iostream> #include <ctime> int main() { using namespace std; time_t qTime; // Get the number of seconds since midnight Jan. 1, 1970 time(&qTime); // Convert the seconds to a string which describes the local time char* cpLocalTime = ctime(&qTime); cout << "The local time is " << cpLocalTime << endl; return 0; }
© 20072023 XoaX.net LLC. All rights reserved.