411 REFERENCE · Wikibooks
C programming/time.h/localtime
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
localtime is a library function in time.h. It converts calendar time into local time.
Syntax
#include <time.h>
struct tm * localtime ( const time_t * ptr_time );
Parameters
The pointer ptr_time is a pointer to a time_t object that contains a calendar time.
Return Value
The function localtime returns a pointer to a tm structure. The tm structure contains the time information.
Explanation
The function localtime uses the time pointed by the pointer ptr_time to fill a tm structure with the values that represent the corresponding local time.
If this function is called, it returns the localtime in the form
"day Month date hr:min:sec year"((Output)).
References
deep