From owner-freebsd-bugs Wed Oct 2 10: 0:14 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 E00CD37B401 for ; Wed, 2 Oct 2002 10:00:11 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0905943E42 for ; Wed, 2 Oct 2002 10:00:10 -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 g92H09Co003101 for ; Wed, 2 Oct 2002 10:00:09 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g92H091Y003100; Wed, 2 Oct 2002 10:00:09 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D0F5237B401 for ; Wed, 2 Oct 2002 09:50:27 -0700 (PDT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 679C243E6A for ; Wed, 2 Oct 2002 09:50:27 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.6/8.12.6) with ESMTP id g92GoQ7R047932 for ; Wed, 2 Oct 2002 09:50:26 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.6/8.12.6/Submit) id g92GoQtZ047931; Wed, 2 Oct 2002 09:50:26 -0700 (PDT) Message-Id: <200210021650.g92GoQtZ047931@www.freebsd.org> Date: Wed, 2 Oct 2002 09:50:26 -0700 (PDT) From: Ben Burke To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/43592: mktime rejects dates at the start of daylight savings time 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 >Number: 43592 >Category: bin >Synopsis: mktime rejects dates at the start of daylight savings time >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Oct 02 10:00:09 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Ben Burke >Release: 4.6-STABLE >Organization: Iowa365 >Environment: FreeBSD watchtower.office.parksmediagroup.com 4.6-STABLE FreeBSD 4.6-STABLE #0: Mon Sep 2 06:57:32 CDT 2002 root@mymachine:/usr/src/sys/compile/BEN.2002.09.02.R1 i386 >Description: FreeBSD's mktime behavior for the "missing" hour at the start of daylight savings time is to return -1. Other OSes that I use and have tested compensate for this gap. The short program below shows the leap from 1 AM to -1 on FreeBSD, and from 1 AM to 3 AM on Linux or OSX. >How-To-Repeat: Compile the short C++ program below and run. #include #include 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"; /* 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"; } >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message