Re: IntlTimeZone::getOffset?

From: Date: Mon, 01 Jul 2013 02:13:46 +0000
Subject: Re: IntlTimeZone::getOffset?
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-68023@lists.php.net to get a copy of this message
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

« previous php.internals (#68023) next »