Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <ctime >
- # include <iostream >
- #include <sstream>
- using namespace std;
- void print_time()
- {
- stringstream s;
- time_t t = time(0);
- struct tm now;
- localtime_s(&now, &t);
- s
- << now.tm_hour << ':' << now.tm_min << ':'
- << now.tm_sec << endl;
- cout << s.str() << endl;
- }
- int main(int argc, char **argv) {
- print_time();
- getchar(); getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement