Hey sorry if the name is stupid, but I'm really not too sure what it is I am trying to do, I'll try make it easy to help.
I basically have something like this example:
1 2 3 4 5 6 7 8 9 10 11 12
|
int main ()
{
time_t rawtime;
tm * ptm;
time ( &rawtime );
ptm = gmtime ( &rawtime );
puts ("Current time around the World:");
printf ("GMT-11 : %2d:%02d\n", (ptm->tm_hour+gmt011) %24, ptm->tm_min);
printf ("GMT-10 : %2d:%02d\n", (ptm->tm_hour+gmt010) %24, ptm->tm_min);
|
and what I want to do is, make the output of either of the last 2 lines into the input for a variable, so I can make all from gmt-12 through to gmt+13 a variable. Then I want to be able to output only the variable that's time is in between now and then (3 and 4 o'clock for e.g).
This is what I was trying to do, but don't think it is right at all.
1 2 3 4 5 6 7 8
|
if (ptm->tm_hour %24, ptm->tm_min > '03:00')
{
printf ("GMT/UTC : %2d:%02d\n", (ptm->tm_hour) %24, ptm->tm_min);
}
else
{
cout << "fail";
}
|
I hope that makes sense, I do not wish for my puzzle to be solved for me through this, just to get taught from a person what I am doing, and the basics of going about it, as I have tried searching and that, but don't even know what to search for in the end of it =\. I am a true beginner.. Thanks in advance for any help you can provide.