From owner-freebsd-stable@FreeBSD.ORG Sat Feb 12 20:51:23 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 C379016A4CE for ; Sat, 12 Feb 2005 20:51:23 +0000 (GMT) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2848243D48 for ; Sat, 12 Feb 2005 20:51:23 +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]) j1CKp5ua031513 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 13 Feb 2005 07:51:07 +1100 Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1])j1CKp57l068932; Sun, 13 Feb 2005 07:51:05 +1100 (EST) (envelope-from pjeremy@cirb503493.alcatel.com.au) Received: (from pjeremy@localhost)j1CKp4Sp068931; Sun, 13 Feb 2005 07:51:04 +1100 (EST) (envelope-from pjeremy) Date: Sun, 13 Feb 2005 07:51:04 +1100 From: Peter Jeremy To: Marcus Grando Message-ID: <20050212205104.GF62061@cirb503493.alcatel.com.au> References: <420D3CB0.2030101@corp.grupos.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <420D3CB0.2030101@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: Sat, 12 Feb 2005 20:51:23 -0000 On Fri, 2005-Feb-11 21:16:00 -0200, Marcus Grando wrote: >I have problems with mktime() on FreeBSD 4.11-STABLE and daylight timezone. > >My timezone is "America/Sao_Paulo", daylight begin on 2004-11-02 00:00 >and terminate on 2005-02-20 00:00. > >The problem is: >If run this code[1] on FreeBSD 4.11-STABLE, then return -1, if run on >FreeBSD 5.3-STABLE, then return 1099364400 (correct) and if run on >Linux, then return 1099364400 (correct). To be pedantic, FreeBSD 4.11 is correct and the others are wrong. If 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. server% TZ=':/usr/share/zoneinfo/America/Sao_Paulo' perl -e 'print scalar localtime 1099364400,"\n";' Tue Nov 2 01:00:00 2004 server% TZ=':/usr/share/zoneinfo/America/Sao_Paulo' perl -e 'print scalar localtime 1099364399,"\n";' Mon Nov 1 23:59:59 2004 server% -- Peter Jeremy