Explaining current local time function

I have a function which prints out the local time stamp when the function is called, I have it working fine but would like to understand more of how it is working, particularly what is happening at the buffer section. (I've add comments on how I understand each line to be working)

1
2
3
4
5
6
7
8
9
10
  int timeFound() {
  time_t rawtime; //Variable of type time_t which counts time in seconds
  struct tm * timeinfo; //structure containing?
  char buffer [80]; //creating a buffer of 80 char
  time (&rawtime);
  timeinfo = localtime (&rawtime);
  strftime (buffer,80," %Y-%m-%dT%H:%M:%S",timeinfo); //adding info to buffer?
  puts (buffer); //prints buffer?
  return 0;
}
Last edited on
Topic archived. No new replies allowed.