I am confused....I printed __TIME__
in C then it prints time and then again after 5 seconds I executed it. I did it for 5 times. But for all the times, the time remained same. Time is not getting changed even not second also getting changed. All the time hours minutes and seconds remain same. So how can I print Current Time and Date using time.h
__TIME__
is a preprocessor macro that expands to the time at which the file was compiled. It will not change between consecutive runs of the program. As you can see in the link to the documentation that I posted, it clearly says that it expands to a "string constant".
If you want to get the current time, have a look at the time.h
header.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments