diff -Naur a/parsetime.y b/parsetime.y --- a/parsetime.y 2005-08-05 03:31:04.000000000 +0000 +++ b/parsetime.y 2007-11-23 19:39:29.000000000 +0000 @@ -4,12 +4,15 @@ #include #include #include "parsetime.h" +#include "at.h" +#include "panic.h" #define YYDEBUG 1 static const char *svnid = "$Id$"; struct tm exectm; static int isgmt; +static char *tz = NULL; static int yearspec; static int time_only; @@ -170,6 +173,12 @@ timezone_name : UTC { isgmt = 1; + if (getenv("TZ")) { + tz = (char *) mymalloc(strlen(getenv("TZ")) + 1); + strcpy(tz, getenv("TZ")); + } + if (setenv("TZ", "UTC0", 1) == -1) + panic("Virtual memory exhausted"); } ; @@ -502,9 +511,13 @@ if (exectime == (time_t)-1) return 0; if (isgmt) { - exectime -= timezone; - if (currtm.tm_isdst && !exectm.tm_isdst) - exectime -= 3600; + if (tz) { + if (setenv("TZ", tz, 1) == -1) + panic("Virtual memory exhausted"); + free(tz); + } + else + unsetenv("TZ"); } if (exectime < currtime) panic("refusing to create job destined in the past");