gmtime()

Converts a time_t value to Coordinated Universal Time (UTC).

  #include <time.h>
  
  struct tm *gmtime(const time_t *time);    
Parameter

time

A pointer to a time value.

Remarks

This function converts the calendar time pointed to by time into a broken-down time, expressed as UTC. The function function returns a pointer to that object.

This facility may not be available on some configurations of the EWL.

Listing: 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