--- libdbi-0.8.1/src/dbd_helper.c	2005-08-17 15:25:15.000000000 -0400
+++ /home/miker/dbd_helper.c	2006-05-11 21:12:55.000000000 -0400
@@ -267,6 +267,12 @@ time_t _dbd_parse_datetime(const char *r
 	struct tm unixtime;
 	char *unparsed;
 	char *cur;
+
+	int _gm_offset = 0;
+	int _tz_dir = 0;
+	int _tz_hours = 0;
+	int _tz_mins = 0;
+
 	int check_time = 1;
 
 	unixtime.tm_sec = unixtime.tm_min = unixtime.tm_hour = 0;
@@ -307,13 +313,55 @@ time_t _dbd_parse_datetime(const char *r
 	    unixtime.tm_hour = atoi(cur);
 	    unixtime.tm_min = atoi(cur+3);
 	    unixtime.tm_sec = atoi(cur+6);
+
+	    cur += 8;
+	    if (strlen(cur)) {
+			 
+	      /* fprintf(stderr,"part after : %s\n", cur); */
+
+	      char* _tz_start = index(cur, '-');
+
+	      if (!_tz_start) {
+	         _tz_start = index(cur, '+');
+	         _tz_dir = 1;
+	      }
+
+	      /* fprintf(stderr,"_tz_start says : %s\n", _tz_start); */
+
+	      if (_tz_start) {
+	        cur = _tz_start + 1;
+
+	        /* fprintf(stderr,"_tz_dir is %d, remaining : %s\n", _tz_dir, _tz_start); */
+
+	        if (strlen(cur) > 4) { // there's a minute separator ...
+	          _tz_mins = atoi(cur+3);
+	          cur[2] = '\0';
+	          _tz_hours = atoi(cur);
+
+	        } else if (strlen(cur) > 3) { // hours and minutes
+	          _tz_mins = atoi(cur+2);
+	          cur[2] = '\0';
+	          _tz_hours = atoi(cur);
+				 
+	        } else { // just hours
+	          _tz_hours = atoi(cur);
+	        }
+
+	        _gm_offset += _tz_hours * 60 * 60;
+	        _gm_offset += _tz_mins * 60;
+
+	        if ( _tz_dir ) {
+	          _gm_offset *= -1;
+	        }
+	      }
+	    }
 	  }
 
 	  free(unparsed);
 	}
 
 	/* output is UTC, not local time */
-	return timegm(&unixtime);
+	return (time_t)(_gm_offset + timegm(&unixtime));
 }
 
 /* encoding/decoding of binary strings. The code, including the
