.TH gmtime() "" "" "Time Function (libc)"
.PC "Convert system time to calendar structure"
.B "#include <time.h>"
.B "#include <sys/types.h>"
\fBtm *gmtime(\fItimep\^\fB)\fR
\fBtime_t *\fItimep\^\fB;\fR
.PP
.B gmtime()
converts the internal time from
seconds since midnight January 1, 1970 GMT, into fields that give
integer years since 1900, the month, day of the month, the hour,
the minute, the second, the day of the week, and yearday.
It returns a pointer to the structure
.BR tm ,
which defines these fields, and which is itself defined in the header file
.BR time.h .
Unlike its cousin,
.BR localtime() ,
.B gmtime()
returns Greenwich Mean Time (GMT).
.SH Example
For an example of how to use this function, see
.BR asctime() .
.SH "See Also"
.Xr "GMT," gmt
.Xr "libc," libc
.Xr "localtime()," localtime
.Xr "time [overview]," time.a
.Xr "TIMEZONE" timezone
.br
\*(AS, \(sc7.12.3.3
.br
\*(PX Standard, \(sc8.1
.SH Notes
.B gmtime()
returns a pointer to a statically allocated data area
that is overwritten by successive calls.
