2 * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
4 * $Id: toClockSec.c,v 1.6 2000/06/19 13:28:35 simonmar Exp $
6 * toClockSec Runtime Support
14 toClockSec(I_ year, I_ mon, I_ mday, I_ hour, I_ min, I_ sec, I_ tz, I_ isdst, StgByteArray res)
19 tm.tm_year = year - 1900;
29 #elif defined(HAVE_TIMELOCAL)
37 * mktime expects its argument to be in the local timezone, but
38 * toUTCTime makes UTC-encoded CalendarTime's ...
40 * Since there is no any_tz_struct_tm-to-time_t conversion
41 * function, we have to fake one... :-) If not in all, it works in
42 * most cases (before, it was the other way round...)
44 * Luckily, mktime tells us, what it *thinks* the timezone is, so,
45 * to compensate, we add the timezone difference to mktime's
48 *(time_t *)res = t + tz - GMTOFF(&tm);