$NetBSD: patch-aa,v 1.7 2008/04/16 16:48:25 drochner Exp $

--- applets/clock/calendar-window.c.orig	2008-04-15 22:58:01.000000000 +0200
+++ applets/clock/calendar-window.c
@@ -1161,22 +1161,28 @@ calendar_day_activated (GtkCalendar    *
 	time_t        now;
 	struct tm     utc_tm;
 	struct tm     local_tm;
+	time_t        daystart;
 	char         *argument;
 
 	gtk_calendar_get_date (calendar, &year, &month, &day);
 
-	time (&now);
-	gmtime_r (&now, &utc_tm);
-	localtime_r (&now, &local_tm);
+	bzero(&local_tm, sizeof(local_tm));
+	local_tm.tm_mday = day;
+	local_tm.tm_mon = month;
+	local_tm.tm_year = year - 1900;
+	local_tm.tm_isdst = -1;
+	daystart = mktime(&local_tm);
+	gmtime_r (&daystart, &utc_tm);
 
 	/* FIXME: once bug 409200 is fixed, we'll have to make this hh:mm:ss
 	 * instead of hhmmss */
 	argument = g_strdup_printf ("calendar:///?startdate="
 				    "%.4d%.2d%.2dT%.2d%.2d%.2dZ",
-				    year, month + 1, day,
-				    12 + utc_tm.tm_hour - local_tm.tm_hour,
-				    0  + utc_tm.tm_min  - local_tm.tm_min,
-				    0);
+				    utc_tm.tm_year + 1900, utc_tm.tm_mon + 1,
+				    utc_tm.tm_mday,
+				    utc_tm.tm_hour,
+				    utc_tm.tm_min,
+				    utc_tm.tm_sec);
 
 	clock_launch_evolution (calwin, argument);
 
