totn C Functions

C Language: localtime function
(Convert to Local Time)

In the C Programming Language, the localtime function converts a calendar time (pointed to by timer) and returns a pointer to a structure containing a boken-down local time equivalent.

Syntax

The syntax for the localtime function in the C Language is:

struct tm *localtime(const time_t *timer);

Parameters or Arguments

timer
A pointer to an object of type time_t that contains a time value to convert.

Returns

The localtime function returns a pointer to a structure broken-down local time equivalent describing a calendar time pointed to by timer.

Required Header

In the C Language, the required header for the localtime function is:

#include <time.h>

Applies To

In the C Language, the localtime function can be used in the following versions:

  • ANSI/ISO 9899-1990

Similar Functions

Other C functions that are similar to the localtime function: