http://msdn.microsoft.com/library/defau ... gmtime.asp
代碼: 選擇全部
/* GMTIME.C: This program uses gmtime to convert a long-
* integer representation of coordinated universal time
* to a structure named newtime, then uses asctime to
* convert this structure to an output string.
*/
#include <time.h>
#include <stdio.h>
void main( void )
{
struct tm *newtime;
long ltime;
time( <ime );
/* Obtain coordinated universal time: */
newtime = gmtime( <ime );
printf( "Coordinated universal time is %sn",
asctime( newtime ) );
}