Date: Wed, 2 Oct 2002 12:20:04 -0700 (PDT) From: Garrett Wollman <wollman@lcs.mit.edu> To: freebsd-bugs@FreeBSD.org Subject: bin/43592: mktime rejects dates at the start of daylight savings time Message-ID: <200210021920.g92JK4wK046302@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/43592; it has been noted by GNATS.
From: Garrett Wollman <wollman@lcs.mit.edu>
To: Ben Burke <ben@dubuque365.com>
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)
<<On Wed, 2 Oct 2002 09:50:26 -0700 (PDT), Ben Burke <ben@dubuque365.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210021920.g92JK4wK046302>
