[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


gmtime

Convert a time_t value to Coordinated Universal Time (UTC), which is the new name for Greenwich Mean Time.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <time.h>
struct tm *gmtime(const time_t *timer);
Parameters:

Parameters for this facility are:

timer  
const time_t *  
The address of the time_t variable  

Remarks:

The gmtime function converts the calendar time pointed to by timer into a broken-down time, expressed as UTC.

Return:

The gmtime() function returns a pointer to that object.

Example of gmtime usage.:
#include <time.h>
#include <stdio.h>

int main(void)
{
	time_t systime;
	struct tm *utc;

	systime = time(NULL);
	utc = gmtime(&systime);

	printf("Universal Coordinated Time:\n");
	puts(asctime(utc));	

	return 0;
}

Output:
Universal Coordinated Time:
Thu Feb 24 18:06:10 1994


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000