From owner-freebsd-bugs Wed Oct 2 12:20: 7 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8FB8E37B401 for ; Wed, 2 Oct 2002 12:20:05 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A75043E6E for ; Wed, 2 Oct 2002 12:20:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g92JK4Co046303 for ; Wed, 2 Oct 2002 12:20:05 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g92JK4wK046302; Wed, 2 Oct 2002 12:20:04 -0700 (PDT) Date: Wed, 2 Oct 2002 12:20:04 -0700 (PDT) Message-Id: <200210021920.g92JK4wK046302@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Garrett Wollman Subject: bin/43592: mktime rejects dates at the start of daylight savings time Reply-To: Garrett Wollman Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/43592; it has been noted by GNATS. From: Garrett Wollman To: Ben Burke Cc: freebsd-gnats-submit@FreeBSD.ORG Subject: bin/43592: mktime rejects dates at the start of daylight savings time Date: Wed, 2 Oct 2002 15:11:07 -0400 (EDT) < said: > int main() { > struct tm date1; > date1.tm_sec = 0; /* seconds (0 - 60) */ > date1.tm_min = 0; /* minutes (0 - 59) */ > date1.tm_hour = 2; /* hours (0 - 23) */ > date1.tm_mday = 4; /* day of month (1 - 31) */ > date1.tm_mon = 3; /* month of year (0 - 11) */ > date1.tm_year = 104; /* year - 1900 */ > cout << mktime(&date1) << "\n"; It might help if you initialized date1::tm_isdst before it is used. > /* An hour later */ > struct tm date2; > date2.tm_sec = 0; /* seconds (0 - 60) */ > date2.tm_min = 0; /* minutes (0 - 59) */ > date2.tm_hour = 3; /* hours (0 - 23) */ > date2.tm_mday = 4; /* day of month (1 - 31) */ > date2.tm_mon = 3; /* month of year (0 - 11) */ > date2.tm_year = 104; /* year - 1900 */ > date1.tm_isdst = -1; /* year - 1900 */ > cout << mktime(&date2) << "\n"; Likewise date2::tm_isdst. In order to debug this problem (assuming that it is not simply the result of this error in your code), we will need to know the precise name of the timezone under which you are running the program. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message