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 #15 received at 571762@bugs.debian.org (full text, mbox, reply):

Received: (at 571762) by bugs.debian.org; 27 Feb 2010 22:34:17 +0000
From atomo64@gmail.com Sat Feb 27 22:34:17 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, 4; hammy, 151; neutral, 88; spammy, 0.
	spammytokens: hammytokens:0.000-+--H*RU:sk:atomo64,
	0.000-+--HX-Spam-Relays-External:sk:atomo64, 0.000-+--manpage,
	0.000-+--H*f:sk:2010022, 0.000-+--H*i:sk:2010022
X-Spam-Status: No, score=-8.0 required=4.0 tests=BAYES_00,FROMDEVELOPER,GMAIL,
	HAS_BUG_NUMBER,SPF_PASS autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Return-path: <atomo64@gmail.com>
Received: from mail-wy0-f180.google.com ([74.125.82.180])
	by rietz.debian.org with esmtp (Exim 4.63)
	(envelope-from <atomo64@gmail.com>)
	id 1NlVEn-0002YN-Mr
	for 571762@bugs.debian.org; Sat, 27 Feb 2010 22:34:17 +0000
Received: by wyi11 with SMTP id 11so537567wyi.11
        for <571762@bugs.debian.org>; Sat, 27 Feb 2010 14:34:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:mime-version:sender:received:in-reply-to
         :references:date:x-google-sender-auth:message-id:subject:from:to
         :content-type;
        bh=ms/EzhTE7wDVDEG0vWveLYSLL+fWpyGS/IRL0KY8mJg=;
        b=RnzUnDVxrUWNr3Ps4cmlbPaxTHVDd3s8ejWLbne9E308U6RPhtqGkALzL8vWGSC65j
         bxz+nEpUBQ6O+GAWQLvUjBhJ+/Sa6P+GpGRlNjmyj/5iBCoFhOIiJ4tY48MRDdUTJ/VV
         dt6qvLSZTA6xMtoqGfLHPq163hNsy/N6oCVPE=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=mime-version:sender:in-reply-to:references:date
         :x-google-sender-auth:message-id:subject:from:to:content-type;
        b=uBCsAI6jrYXFmEYnkbMl4tX66sg0vOW7QOuiOczF1myeCceT20agWm6yIh0xk1oPI+
         lLQjTQ/OcdIhl4mNB7O4Kd0TEkGfOF8Fd7bB8g8mdr6tuB5TdfDKDB5C1x8IohsHWXuJ
         gINsspmuLEy0CbeYSV+FcrvrdF95tYEw0gJCY=
MIME-Version: 1.0
Sender: atomo64@gmail.com
Received: by 10.216.88.12 with SMTP id z12mr1665329wee.165.1267310048833; Sat, 
	27 Feb 2010 14:34:08 -0800 (PST)
In-Reply-To: <201002271553.42266.chealer@gmail.com>
References: <201002271553.42266.chealer@gmail.com>
Date: Sat, 27 Feb 2010 16:34:08 -0600
X-Google-Sender-Auth: 70a289c99d473138
Message-ID: <e9fb436d1002271434h57354557r814b5abbe243e5f@mail.gmail.com>
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."
From: Raphael Geissert <geissert@debian.org>
To: Filipus Klutiero <chealer@gmail.com>, 571762@bugs.debian.org
Content-Type: text/plain; charset=UTF-8
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?
"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.

Cheers,
-- 
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jul 2 02:36:01 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.