For future reference to anyone who might need this, I have figured it out:
Code:
time_t now;
struct tm *current;
now = time(0);
current = localtime(&now);
cout << "hour: " << current->tm_hour << endl;
cout << "mins: " << current->tm_min << endl;
cout << "sec: " << current->tm_sec << endl;
struct timeval detail_time;
gettimeofday(&detail_time,NULL);
cout << "milli: " << detail_time.tv_usec/1000 << endl;
This will output (if the time is 6:05:53PM)
Code:
hour: 18
mins: 5
sec: 53
milli: 707
//sec and millisec WILL change obviously