2.1.8.4 convert_time_to_tm


Description

Converts a time value to a structure.

Syntax

void convert_time_to_tm( time_t * pTime, TM * pTM )

Parameters

pTime
[input]pointer to a time_t variable
pTM
[output]pointer to a TM structure to get the result

Return

Examples

EX1

void convert_time_to_tm_ex1()
{
    TM tm1;
    time_t ltime;
    _tzset();
    
    // Get UNIX-style time and display as number and string. 
    time( &ltime );
    convert_time_to_tm(&ltime, &tm1 );
    printf( "Coordinated universal time:\t\t%s", asctime( &tm1 ) );
}

Remark

See Also

gmtime, TM, time, asctime

Header to Include

origin.h

Reference