Is there a cross-platform way to get the current date and time in C++?
You could use boost:
#include #include using namespace boost::gregorian; int main() { date d = day_clock::universal_day(); std::cout << d.day() << " " << d.month() << " " << d.year(); }