1#include <string>
2#include <sstream>
3#include <iostream>
4
5time_t t = time(0); // get time now
6struct tm * now = localtime( & t );
7
8ostringstream osTime;
9osTime << (now->tm_year + 1900) <<
10 (now->tm_mon + 1) <<
11 now->tm_mday <<
12 "\n";
13
14cout << osTime.str();