Index: trunk/src/efuns.c
===================================================================
--- trunk/src/efuns.c	(Revision 2364)
+++ trunk/src/efuns.c	(Arbeitskopie)
@@ -76,6 +76,7 @@
  *    efun: shutdown()
  *    efun: gmtime()
  *    efun: localtime()
+ *    efun: mktime()
  *    efun: time()
  *    efun: utime()
  *
@@ -8734,5 +8735,70 @@
     return sp;
 } /* f_utime() */
 
+/*-------------------------------------------------------------------------*/
+svalue_t *
+f_mktime (svalue_t *sp)
+
+/* EFUN mktime()
+ *
+ *   int time(int* datum)
+ *
+ * Return the unix timestamp (number of seconds ellapsed since 1. Jan 1970, 
+ * 0.0:0 GMT) of the date given in the array datum. datum being an array
+ * like the one localtime() or gmtime() return:
+ *   int TM_SEC   (0) : Seconds (0..59)
+ *   int TM_MIN   (1) : Minutes (0..59)
+ *   int TM_HOUR  (2) : Hours (0..23)
+ *   int TM_MDAY  (3) : Day of the month (1..31)
+ *   int TM_MON   (4) : Month of the year (0..11)
+ *   int TM_YEAR  (5) : Year (e.g.  2001)
+ *   int TM_WDAY  (6) : Day of the week (Sunday = 0)
+ *   int TM_YDAY  (7) : Day of the year (0..365)
+ *   int TM_ISDST (8) : TRUE: Daylight saving time
+ * TM_YDAY and TM_WDAY are ignored (but must also be ints).
+ *
+ */
+{
+    struct tm * pTm; // broken-down time structure for mktime()
+    time_t      clk; // unix timestamp corresponding to datum
+    vector_t  * v;   // just for convenience, stores argument array 
+    int i; 
+
+    v = sp->u.vec;
+    if (VEC_SIZE(v) != 9)
+        errorf("Bad arg 1 to mktime(): Invalid array size %ld, expected 9.\n"
+                 , (long)VEC_SIZE(v));
+    // all elements must be ints.
+    for(i=0; i<VEC_SIZE(v); i++) 
+    {
+        if ( v->item[i].type != T_NUMBER)
+            errorf("Bad arg 1 to mktime(): Element %d is '%s', expected 'int'.\n"
+                 ,i, efun_arg_typename(v->item[0].type));
+    }
+
+    // create the time structure
+    xallocate(pTm, sizeof(*pTm), "broken-down time structure for mktime()");
+    pTm->tm_sec   = v->item[TM_SEC].u.number;
+    pTm->tm_min   = v->item[TM_MIN].u.number;
+    pTm->tm_hour  = v->item[TM_HOUR].u.number;
+    pTm->tm_mday  = v->item[TM_MDAY].u.number;
+    pTm->tm_mon   = v->item[TM_MON].u.number;
+    pTm->tm_year  = v->item[TM_YEAR].u.number - 1900;
+    pTm->tm_isdst = v->item[TM_ISDST].u.number;
+    
+    clk = mktime(pTm);
+
+    // free time structure first
+    xfree(pTm);
+    
+    if (clk == -1)
+        errorf("Specified date/time cannot be represented as unix timestamp.\n");
+    
+    // free argument and put result.
+    free_svalue(sp);
+    put_number(sp, (uint32)clk);
+    
+    return sp;
+} /* f_mktime() */
+
 /***************************************************************************/
-
Index: trunk/src/efuns.h
===================================================================
--- trunk/src/efuns.h	(Revision 2364)
+++ trunk/src/efuns.h	(Arbeitskopie)
@@ -88,6 +88,7 @@
 extern svalue_t *f_shutdown(svalue_t *sp);
 extern svalue_t *f_time(svalue_t *);
 extern svalue_t *f_utime(svalue_t *);
+extern svalue_t *f_mktime(svalue_t *);
 
 #endif /* EFUNS_H__ */
 
Index: trunk/src/func_spec
===================================================================
--- trunk/src/func_spec	(Revision 2364)
+++ trunk/src/func_spec	(Arbeitskopie)
@@ -378,6 +378,7 @@
 int*    utime();
 mixed  *gmtime(int*|int default: F_TIME);
 mixed  *localtime(int*|int default: F_TIME);
+int     mktime(int*);
 
 mixed  *wizlist_info();
 mixed   get_extra_wizinfo(null|object|string);
