Debian Bug report logs - #571762
[php5] please get rid of "Warning: date() [function.date]: It is not safe to rely on the system's timezone settings."

version graph

Package: php5; Maintainer for php5 is (unknown);

Reported by: Filipus Klutiero <chealer@gmail.com>

Date: Sat, 27 Feb 2010 20:57:01 UTC

Severity: wishlist

Found in version php5/5.3.1-5

Fixed in version php5/5.3.2-1

Done: Raphael Geissert <geissert@debian.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 571762@bugs.debian.org (full text, mbox, reply):

Received: (at 571762) by bugs.debian.org; 27 Feb 2010 22:59:44 +0000
From chealer@gmail.com Sat Feb 27 22:59:44 2010
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rietz.debian.org
X-Spam-Level: 
X-Spam-Bayes: score:0.0000 Tokens: new, 7; hammy, 149; neutral, 119; spammy,
	2. spammytokens:0.987-1--H*m:29665, 0.987-1--H*MI:29665
	hammytokens:0.000-+--manpage, 0.000-+--H*f:sk:2010022, 0.000-+--H*u:x86_64,
	0.000-+--H*UA:sk:2.6.32-, 0.000-+--H*u:sk:2.6.32-
X-Spam-Status: No, score=-5.9 required=4.0 tests=AWL,BAYES_00,GMAIL,
	HAS_BUG_NUMBER,SPF_PASS autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Return-path: <chealer@gmail.com>
Received: from mail-vw0-f52.google.com ([209.85.212.52])
	by rietz.debian.org with esmtp (Exim 4.63)
	(envelope-from <chealer@gmail.com>)
	id 1NlVdQ-0000Mn-Gl
	for 571762@bugs.debian.org; Sat, 27 Feb 2010 22:59:44 +0000
Received: by vws4 with SMTP id 4so618476vws.11
        for <571762@bugs.debian.org>; Sat, 27 Feb 2010 14:59:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:subject:date
         :user-agent:references:in-reply-to:mime-version:content-type
         :content-transfer-encoding:message-id;
        bh=ooJQ6kgs/5cqsDW/PA1nOm87eESMAxPZSVAz7svcTCI=;
        b=LKhc5Ii8DVGvHF/l9lOg/gky6j+04b74rcwvAeCfzhpGxaT8WseC5HM5WShP88txB1
         YRL3dwyrOpwm4cIOnTC1Nd+gwoNvaumpnPAiO09k6qKZAyBHZrOmqlF5QMbu/6AsaeJL
         VH0YcNRrFFMjnN1jfofkV/PaG8TZlMjvFaDGk=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:to:subject:date:user-agent:references:in-reply-to:mime-version
         :content-type:content-transfer-encoding:message-id;
        b=HO2NtlhWllfKynczjA78IktZ3OuY3wzo2N8E5qop6L7zdQJOT1g8mbzrW8emanjGV/
         AmfIQxj5uYOdG2yZRYfCYe0mbCYfUbjdRIvOk5ewFORznPPDtLyXG/wYUzYH3x25Z6W5
         bx65S3aiuREBiTnSqRxgm6/ohY0bJxf+oUsGg=
Received: by 10.220.107.104 with SMTP id a40mr1729745vcp.67.1267311572897;
        Sat, 27 Feb 2010 14:59:32 -0800 (PST)
Received: from vinci.localnet (dsl-67-204-62-23.acanac.net [67.204.62.23])
        by mx.google.com with ESMTPS id 37sm14314107vws.18.2010.02.27.14.59.31
        (version=SSLv3 cipher=RC4-MD5);
        Sat, 27 Feb 2010 14:59:31 -0800 (PST)
From: Filipus Klutiero <chealer@gmail.com>
To: 571762@bugs.debian.org
Subject: Re: [php-maint] Bug#571762: [php5] please get rid of "Warning: date() [function.date]: It is not safe to rely on the system's timezone settings."
Date: Sat, 27 Feb 2010 17:59:29 -0500
User-Agent: KMail/1.12.4 (Linux/2.6.32-trunk-amd64; KDE/4.3.4; x86_64; ; )
References: <201002271553.42266.chealer@gmail.com> <e9fb436d1002271434h57354557r814b5abbe243e5f@mail.gmail.com>
In-Reply-To: <e9fb436d1002271434h57354557r814b5abbe243e5f@mail.gmail.com>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Message-Id: <201002271759.29665.chealer@gmail.com>
Le février 27, 2010 05:34:08 PM, Raphael Geissert a écrit :
> On 27 February 2010 14:53, Filipus Klutiero <chealer@gmail.com> wrote:
> > With PHP 5.3, it is now strongly recommended to set the timezone; failure
> > to do so makes date('U'), for example, trigger an E_WARNING (while time()
> > is fine):
> > http://www.php.net/manual/en/function.date-default-timezone-set.php
> >
> > This is really annoying.
> 
> If you want to change that, file a bug report upstream.
> 
> > For example:
> 
> [...]
> 
> > I have *no idea* where 'EST/-5.0/no DST' comes from, although the system
> > *is* in GMT-5. IMO, there's even a bug here. The default PHP
> > configuration doesn't set date.timezone. This is, IMO, the right thing to
> > do. Searching for elements of this message on Google gives an idea of how
> > much this change broke.
> 
> Why do you think that hard-coding (even if modified at install-time)
> the time-zone is better than letting php figure it out at runtime?

I was saying I think it's better to get the timezone at runtime, as is 
currently done. Configuring it would leave it outdated if the system would 
change timezone.

> "EST/-5.0/no DST" comes from a call to the localtime_r(3) function,
> refer to its manpage for more information.
> 
> > Telling me that my Debian system's timezone settings are unreliable is
> > not something I expect from software coming from timezones less than 10
> > years behind mine. A *change* in this direction is quite frustrating.
> 
> [...]
> 
> > Since date_default_timezone_set() was not used, TZ is not set and
> > date.timezone was not set, date_default_timezone_get() must be "Querying
> > the host operating system (if supported and allowed by the OS)".
> 
> And that's exactly what it does.

That must be right, and PHP must be using localtime_r incorrectly, although it 
basically works.

Thank you




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jul 2 02:35:57 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.