.\" 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
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;
.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/.