Home Segments Index Top Previous Next

586: Mainline

The time-structure object itself has structure variables with difficult-to-remember names. You have no need to remember them, however, because you can extract values from those structure variables, and assign those values to global variables with fully spelled-out names, once and for all:

/* Extract useful information from the time structure */ 
year = 1900 + time_structure_pointer -> tm_year; 
month = time_structure_pointer -> tm_mon; 
day = time_structure_pointer -> tm_mday; 
hour = time_structure_pointer -> tm_hour; 
minute = time_structure_pointer -> tm_min;