This should get you started:
Code:
#include <ctime>
using namespace std;
int main (int argc, char** argv)
{
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
// Manipulate timeinfo
return 0;
}
You should store rawtime each time the game is run, and retrieve it once the user starts the game again. Once you read in this value, feed it into a tm struct (like shown above) and manipulate its members. tm struct reference: http://www.cplusplus.com/ref/ctime/tm.html