Go to the first, previous, next, last section, table of contents.


gmtime

Syntax

#include <time.h>

struct tm *gmtime(const time_t *tod);

Description

Converts the time represented by tod into a structure.

The return structure has this format:

struct tm {
  int    tm_sec;    /* seconds after the minute [0-60] */
  int    tm_min;    /* minutes after the hour [0-59] */
  int    tm_hour;   /* hours since midnight [0-23] */
  int    tm_mday;   /* day of the month [1-31] */
  int    tm_mon;    /* months since January [0-11] */
  int    tm_year;   /* years since 1900 */
  int    tm_wday;   /* days since Sunday [0-6] */
  int    tm_yday;   /* days since January 1 [0-365] */
  int    tm_isdst;  /* Daylight Savings Time flag */
  long   tm_gmtoff; /* offset from GMT in seconds */
  char * tm_zone;   /* timezone abbreviation */
};

Return Value

A pointer to a static structure which is overwritten with each call.

Portability

ANSI, POSIX

Example

time_t x;
struct tm *t;
time(&x);
t = gmtime(&t);


Go to the first, previous, next, last section, table of contents.