Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68023 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70422 invoked from network); 1 Jul 2013 02:13:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jul 2013 02:13:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.22 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.22 smtp2.ist.utl.pt Linux 2.6 Received: from [193.136.128.22] ([193.136.128.22:59188] helo=smtp2.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B8/C0-63159-ED5E0D15 for ; Sun, 30 Jun 2013 22:13:51 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 3EB77700043D; Mon, 1 Jul 2013 03:13:47 +0100 (WEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp2.ist.utl.pt ([127.0.0.1]) by localhost (smtp2.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id B3ZywBtJQ5Xq; Mon, 1 Jul 2013 03:13:47 +0100 (WEST) Received: from nebm.ist.utl.pt (unknown [IPv6:2001:690:2100:4::58:1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id E4E637000436; Mon, 1 Jul 2013 03:13:46 +0100 (WEST) Received: from localhost ([127.0.0.1] helo=nebm.ist.utl.pt) by nebm.ist.utl.pt with esmtp (Exim 4.72) (envelope-from ) id 1UtTcg-0006Fi-HO; Mon, 01 Jul 2013 03:13:46 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 01 Jul 2013 04:13:46 +0200 To: Stas Malyshev Cc: PHP Internals Organization: =?UTF-8?Q?N=C3=BAcleo_de_Engenharia_Biom=C3=A9dica_do_Insti?= =?UTF-8?Q?tuto_Superior_T=C3=A9cnico?= In-Reply-To: <51D0AA4C.9020805@sugarcrm.com> References: <51D0AA4C.9020805@sugarcrm.com> Message-ID: <2e3d0947cdbe7832ec27295eadad9b5d@nebm.ist.utl.pt> X-Sender: glopes@nebm.ist.utl.pt User-Agent: RoundCube Webmail/0.8-rc Subject: Re: =?UTF-8?Q?IntlTimeZone=3A=3AgetOffset=3F?= From: glopes@nebm.ist.utl.pt (Gustavo Lopes) Em 2013-06-30 23:59, Stas Malyshev escreveu: > > I have a question about IntlTimeZone::getOffset - what is the first > parameter it accepts? Is it UTC timestamp? The type is double, but > I'm > not sure what exactly this double is supposed to mean. It can be a UTC timestamp (if $local is false), but note it's in milliseconds since the epoch, not seconds. The documentation is here: http://www.icu-project.org/apiref/icu4c/classicu_1_1TimeZone.html#a026e66c6f698915089c3a3ab29dfd80b And for UDate (which is typedefed to double in ICU4C and represented as a float in PHP): http://www.icu-project.org/apiref/icu4c/utypes_8h.html#ace1704e9e77d407d1eaaa2e73ec0c039 If $local is false, then it's a "local" timestamp; from what I can tell, this is the UTC timestamp of the relevant instant + effective timezone offset at that instant. Put another way, the local timestamp is the UTC timestamp that would yield the same UTC date/time as the local wall time at issue. This has the usual problems at DST transitions, see this comment: http://lxr.php.net/xref/THIRD_PARTY/ICU4C/source/i18n/timezone.cpp#661 -- Gustavo Lopes