Hi,
I have the below program to obtain current date and time.
int main(void)
{
time_t result;
result = time(NULL);
struct tm* brokentime = localtime(&result);
printf("%s", asctime(brokentime));
return(0);
}
And the output of the program is as follows :
Tue Aug 24 01:02:41 2010
How do I retrieve only the hour value say 01 from the above ?
Or is there any other system call where the currect hour of the system can be obtained ? I need to take an action based on this.
Thanks