Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19187 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2400 invoked by uid 1010); 27 Sep 2005 11:57:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 2385 invoked from network); 27 Sep 2005 11:57:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Sep 2005 11:57:42 -0000 X-Host-Fingerprint: 82.94.239.5 jdi.jdi-ict.nl Linux 2.5 (sometimes 2.4) (4) Received: from ([82.94.239.5:56681] helo=jdi.jdi-ict.nl) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id C3/25-54476-3B339334 for ; Tue, 27 Sep 2005 07:57:40 -0400 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.12.11/8.12.11) with ESMTP id j8RBvbvi004197; Tue, 27 Sep 2005 13:57:37 +0200 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.12.11/8.12.11) with ESMTP id j8RBvVfv004180; Tue, 27 Sep 2005 13:57:33 +0200 Date: Tue, 27 Sep 2005 13:57:31 +0200 (CEST) X-X-Sender: derick@localhost To: Stanislav Malyshev cc: PHP Development In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at jdi-ict.nl Subject: Re: [PHP-DEV] timezones & date() breakage From: derick@php.net (Derick Rethans) On Tue, 27 Sep 2005, Stanislav Malyshev wrote: > The timezone is named IDT currently, but the problem is not in this - the > problem is in "we can add it". OK, we add this one - how many ones out > there we didn't add yet? So we will be fixing it for years and still get > it not work in some places - while before the "improvement" it worked! Using a timezone abbreviation is a bad thing anyway. Your timezone is "Isreal/Tel Aviv" and *currently* your abbreviation is IDT. IDT is not a timezone, it is the description of the period in which you use DST in combination with Israel time. > Most probably you will naver have the full list - since both Unix and > Windows allows to extend their timezone databases, and even more funny > thing - they allow changing rules for timezones. Does this library use OS > timezone database? As I already said, no, it does not use the OS's timezone database for the obvious reasons mentioned. > Then even if you would add the name there, who would guarantee you that > the rules your library is using is the same rules the rest of OS is using? > That your app won't jump from DST to standard a week too early? The timezone database that I use is updated from the respected Olson database. All distributions use this (and I hope also Windows). If the distributions don't, then *their* information is incorrect and not PHP's. This is one of the reasons why we have our own database. > And I don't see why you one can't use OS services to check timezones - > AFAIK most OSes provide these. But they are totally crippled. Timezone abbreviations are not unique (EST is both Eastern US, and Eastern Australia for example) and do NOT provide you with a solid way of handling all the complicate matters - believe me, i've been there. There is no other sensible way then doing this ourselves - the only thing is that you actually have to specify your timezone in your php.ini file now. > DR>>Turn on E_STRICT error reporting... and see the documentation: > DR>>http://php.net/manual/en/ref.datetime.php > > Can you quote where it says how can I fix it? And more importantly - how > someone as a PHP programmer and not C programmer can fix it if your > library doesn't know his timezone? date.timezone string The default timezone used by all date/time functions if the TZ environment variable isn't set. The precedence order is described in the date_default_timezone_get() page. http://no2.php.net/manual/en/function.date-default-timezone-get.php says: This functions returns the default timezone, using the following "guess" order: * The timezone set using the date_default_timezone_set() function (if any) * The TZ environment variable (if non empty) * The date.timezone ini option (if set) * "magical" guess (if the operating system supports it) * If none of the above options succeeds, return UTC The one that the C code recognizes is already a fallback in case you don't set this setting. You don't need to change any C code in order to pick the correct timezone. (And for you you should use "Asia/Tel_Aviv" as setting). regards, Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org