c++ get datetime code example
Example: how to get current time in c++
//Simplest way to add time using ctime
#include <ctime>
time_t tt;
time( &tt );
tm TM = *localtime( &tt );
//Must add 1 to month and 1900 to the year
int month=TM.tm_mon+1;
int day=TM.tm_mday;
int year=TM.tm_year+1900;