I knew it couldn't be that simple. Next time work on the vagueness a little. Precise questions deserve precise answers I always say.
cpp
#include <stdio.h>
#include <time.h>
#include <iostream>
using namespace std;
int main ()
{
// Create a raw time_t variable and a tm structure
time_t rawtime;
struct tm * timeinfo;
// Get the current time and place it in time_t
time ( &rawtime );
// Get the locatime from the time_t and put it into our structure timeinfo
timeinfo = localtime ( &rawtime );
// Now we have access to hours, minutes, seconds etc as member variables of all type int
int hour = timeinfo->tm_hour;
int min = timeinfo->tm_min;
// Just print out the hours and minutes to show you
cout << "Hour is: " << hour << " and minutes are: " << min << endl;
return 0;
}
Just an example for you to play with. Enjoy!
"At DIC we be time mastering code ninjas... with that said, I say it is miller time!"