Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Dec 1999 13:00:02 -0800 (PST)
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/15520: mktime() fails under certain conditions 
Message-ID:  <199912162100.NAA34729@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/15520; it has been noted by GNATS.

From: Poul-Henning Kamp <phk@critter.freebsd.dk>
To: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/15520: mktime() fails under certain conditions 
Date: Thu, 16 Dec 1999 21:52:17 +0100

 In message <19991216213647.A34480@internal>, Andre Albsmeier writes:
 >On Thu, 16-Dec-1999 at 21:24:41 +0100, Poul-Henning Kamp wrote:
 >> In message <199912162016.VAA97593@internal>, Andre Albsmeier writes:
 >> 
 >> There is no 02:00:00 that night.  If they test for that, they're
 >> crazy.
 >
 >Yes, the time does not exist. However, I only wonder it our
 >behaviour of returning an error is correct in this case. I don't
 >trust the GNU/Linux guys as much as I trust FreeBSD :-) but there
 >might be a reason they are testing it.
 >
 >I was already asked in private email if the mktime() should
 >succeed according to POSIX.1... Does somebody know anything
 >about that?
 
 Well, Hum.  It seems to say that the fields are not constrained
 to their normal domains:
 
 	The original values of the tm_wday and tm_yday components
 	of the structure are ignored, and the original values of
 	the other components are not restricted to the ranges
 	described in the <time.h> entry.
 
 It does not describe what should happen if I ask it to make a time
 out of 25:100:100, but I guess most of us can agree what it should
 do.
 
 The trouble with passing it 02:00:00 or for that matter 02:59:00
 on the "spring forward" night, is that the time doesn't exist in
 the first place:  Ie,  does 02:10:00 represent
 
 	01:59:59 + 10:59 = 03:10:00
 or 
 	03:00:00 - 50:00 = 01:10:00
 
 Since no sane argument either way really holds water, I think
 returning an error is correct.
 
 --
 Poul-Henning Kamp             FreeBSD coreteam member
 phk@FreeBSD.ORG               "Real hackers run -current on their laptop."
 FreeBSD -- It will take a long time before progress goes too far!
 


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?199912162100.NAA34729>