.\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
-.TH TIMEGM 3 2007-07-26 "GNU" "Linux Programmer's Manual"
+.TH TIMEGM 3 2013-07-04 "GNU" "Linux Programmer's Manual"
.SH NAME
timegm, timelocal \- inverses of gmtime and localtime
.SH SYNOPSIS
.BR localtime (3)
and
.BR gmtime (3).
-.SH "CONFORMING TO"
+.SH CONFORMING TO
These functions are nonstandard GNU extensions
that are also present on the BSDs.
Avoid their use; see NOTES.
char *tz;
tz = getenv("TZ");
+ if (tz)
+ tz = strdup(tz);
setenv("TZ", "", 1);
tzset();
ret = mktime(tm);
- if (tz)
+ if (tz) {
setenv("TZ", tz, 1);
- else
+ free(tz);
+ } else
unsetenv("TZ");
tzset();
return ret;
}
.fi
.in
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR gmtime (3),
.BR localtime (3),
.BR mktime (3),
.BR tzset (3)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.