2.15.7 localtime

Declaration:

struct tm *localtime(const time_t *timer);

The value of timer is broken up into the structure tm and expressed in the local time zone.

A pointer to the structure is returned.

Example:

#include<time.h>
#include<stdio.h>

int main(void)
{
  time_t timer;

  timer=time(NULL);
  printf("The current time is %s.\n",asctime(localtime(&timer)));
  return 0;
}