From owner-freebsd-stable@FreeBSD.ORG Mon Feb 14 18:49:37 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2F85416A4CE for ; Mon, 14 Feb 2005 18:49:37 +0000 (GMT) Received: from mail18.syd.optusnet.com.au (mail18.syd.optusnet.com.au [211.29.132.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E54A43D4C for ; Mon, 14 Feb 2005 18:49:34 +0000 (GMT) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (c211-30-75-229.belrs2.nsw.optusnet.com.au [211.30.75.229]) j1EInB6v029818 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 15 Feb 2005 05:49:12 +1100 Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1])j1EInA7l071844; Tue, 15 Feb 2005 05:49:11 +1100 (EST) (envelope-from pjeremy@cirb503493.alcatel.com.au) Received: (from pjeremy@localhost)j1EInAYU071843; Tue, 15 Feb 2005 05:49:10 +1100 (EST) (envelope-from pjeremy) Date: Tue, 15 Feb 2005 05:49:10 +1100 From: Peter Jeremy To: Marcus Grando Message-ID: <20050214184909.GH57256@cirb503493.alcatel.com.au> References: <420D3CB0.2030101@corp.grupos.com.br> <20050212205104.GF62061@cirb503493.alcatel.com.au> <4210941E.7070202@corp.grupos.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4210941E.7070202@corp.grupos.com.br> User-Agent: Mutt/1.4.2i cc: freebsd-stable@freebsd.org Subject: Re: mktime() bug? result strtotime() fail in PHP X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2005 18:49:37 -0000 On Mon, 2005-Feb-14 10:05:50 -0200, Marcus Grando wrote: >Peter Jeremy wrote: >>To be pedantic, FreeBSD 4.11 is correct and the others are wrong. If > ^^^^^^ >Also FreeBSD 5.3-STABLE? I don't have a 5.3-STABLE system to confirm but if it doesn't return -1 it is wrong. >>DST started at 2004-11-02 00:00 local time then you can't convert a local >>time of 2004-11-02 00:00:00 because that time doesn't exist - your local >>time goes 2004-11-01 23:59:59, 2004-11-02 01:00:00, 2004-11-02 01:00:01. > >I know, but timestamp return is better of that -1. What timestamp should it return? 2004-11-02 00:00:00 doesn't exist for you, therefore there is no possible value for seconds since epoch that will convert to this time. The manpage states: until tm_mon and tm_year are determined. The mktime() function returns the specified calendar time; if the calendar time cannot be represented, it returns -1; Since 2004-11-02 00:00:00 cannot be represented, then it should return -1. Maybe you should explain why having mktime() correctly report an error is a problem for you. -- Peter Jeremy