Home Segments Index Top Previous Next

714: Mainline

The following illustrates:

#include   
#include  
time_t elapsed_seconds; 
struct tm *time_structure_pointer; 
char time_buffer[100]; 
main ( ) { 
  time(&elapsed_seconds); 
  time_structure_pointer = localtime (&elapsed_seconds); 
  strftime (time_buffer, 100, "%A", time_structure_pointer); 
  printf ("Today happens to be %s.\n", time_buffer); 
} 
--- Result --- 
Today happens to be Friday.