Syntax:
#include <ctime> struct tm *localtime( const time_t *time );
The function localtime() converts calendar time time
into local time.
The struct that is returned is statically allocated, and should not be deleted.
For example, the following code uses several of the time-related functions to display the current time:
time_t theTime; time( &theTime ); // get the calendar time tm *t = localtime( &theTime ); // convert to local cout << "The time is: " << asctime(t);
The above code might display this output:
The time is: Fri Oct 17 08:54:41 2008
Related Topics: asctime, ctime, difftime, gmtime, strftime, time