#define TM_YEAR_ORIGIN 1900
+#ifndef GETDATE_IGNORE_TIMEZONE
+
/* Yield A - B, measured in seconds. */
static long
difftm (a, b)
+ (a->tm_sec - b->tm_sec));
}
+#endif
+
time_t
get_date (p, now)
const char *p;
zone by 24 hours to compensate. This algorithm assumes that
there is no DST transition within a day of the time_t boundaries. */
+#ifndef GETDATE_IGNORE_TIMEZONE
if (yyHaveZone)
{
tm = tm0;
}
Start = mktime (&tm);
}
+#endif
if (Start == (time_t) -1)
return Start;
return Start;
}
+#ifndef GETDATE_IGNORE_TIMEZONE
if (yyHaveZone)
{
long delta = yyTimezone * 60L + difftm (&tm, gmtime (&Start));
return -1; /* time_t overflow */
Start += delta;
}
+#endif
return Start;
}