Index: soup-date.c
===================================================================
--- soup-date.c	(revision 1153)
+++ soup-date.c	(working copy)
@@ -542,6 +542,7 @@
 soup_date_to_time_t (SoupDate *date)
 {
 	time_t tt;
+	GTimeVal val;
 
 	/* FIXME: offset, etc */
 
@@ -557,8 +558,8 @@
 	if (sizeof (time_t) == 4 && date->year > 2038)
 		return (time_t)0x7fffffff;
 
-	tt = rata_die_day (date) - TIME_T_EPOCH_RATA_DIE_DAY;
-	tt = ((((tt * 24) + date->hour) * 60) + date->minute) * 60 + date->second;
+	soup_date_to_timeval (date, &val);
+	tt = val.tv_sec;
 
 	if (sizeof (time_t) == 4 && tt < 0)
 		return (time_t)0x7fffffff;
@@ -566,6 +567,23 @@
 }
 
 /**
+ * soup_date_to_timeval:
+ * @date: a #SoupDate
+ * @time: a #GTimeVal structure in which to store the converted time.
+ *
+ * Converts @date to a #GTimeVal.
+ */
+void
+soup_date_to_timeval (SoupDate *date, GTimeVal *time)
+{
+	/* FIXME: offset, etc */
+
+	time->tv_sec = rata_die_day (date) - TIME_T_EPOCH_RATA_DIE_DAY;
+	time->tv_sec = ((((time->tv_sec * 24) + date->hour) * 60) + date->minute) * 60 + date->second;
+	time->tv_usec = 0;
+}
+
+/**
  * soup_date_is_past:
  * @date: a #SoupDate
  *
Index: soup-date.h
===================================================================
--- soup-date.h	(revision 1153)
+++ soup-date.h	(working copy)
@@ -51,6 +51,8 @@
 char     *soup_date_to_string       (SoupDate       *date,
 				     SoupDateFormat  format);
 time_t    soup_date_to_time_t       (SoupDate       *date);
+void      soup_date_to_timeval      (SoupDate       *date,
+				     GTimeVal       *time);
 
 gboolean  soup_date_is_past         (SoupDate       *date);
 
