For Programmers: Free Programming Magazines  


Home > Archive > PHP Questions and Answers > April 2004 > Re: [PHP-QA] php-4.3.6 time tests bad for Solaris









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-QA] php-4.3.6 time tests bad for Solaris
Derick Rethans

2004-04-19, 5:42 am

On Mon, 19 Apr 2004, Hans Werner Strube wrote:

> the time tests 003.phpt, bug21966.phpt, bug27780.phpt, mktime.phpt in
> ext/standard/tests/time fail in Solaris, not because php is bad but
> because the time zones Europe/London, America/Chicago, Europe/Amsterdam,
> Asia/Jerusalem, Asia/Singapore, America/Sao_Paulo are undefined - at least
> by these names - in Solaris (7 and 8; don't know 9 and 10).


Yup, I'm aware of that. Do you know the corresponding names that Solaris
does know? (And I think 9 or 10 does know them, but has sometimes wrong
data associated with it).

regards,
Derick
Derick Rethans

2004-04-19, 10:32 am

On Mon, 19 Apr 2004, Hans Werner Strube wrote:

>
> No. But I just found that the source rule files for those zones are present
> (with lower-case initial) but would have to be compiled by "zic". E.g.,
> "zic /usr/share/lib/zoneinfo/europe" yields subdirectories with files:


Can you do me a favor and email those zone definition files to me? I'd
like to see if they contain the correct information (as I saw some of
the output was wrong with other tests on Solaris, and I'd like to know
why).

Anyway, if you compile those timezones, does the test work then?

regards,
Derick

PS: Please CC php-qa@lists.php.net in further replies.
Hans Werner Strube

2004-04-19, 11:32 am

> Can you do me a favor and email those zone definition files to me? I'd
> like to see if they contain the correct information (as I saw some of>
> the output was wrong with other tests on Solaris, and I'd like to know
> why).


I have attached the source files from the zoneinfo directories from our
Solaris 7 and 8 computers.

> Anyway, if you compile those timezones, does the test work then?


Yes, tested under Solaris 7. But the mktime.phpt test yields some
differences:
--FILE--
int(1009843200)
int(1009843200)
int(1009843200)
int(1009843200)
int(1025481600)
int(1025481600)
int(1025481600)
int(1025481600)
int(1009843200)
int(1009843200)
int(1009843200)
int(1009839600)
int(1025478000)
int(1025478000)
int(1025481600)
int(1025478000)
--EXPECTF--
int(1009843200)
int(1009843200)
int(1009843200)
int(%s)
int(1025481600)
int(1025481600)
int(1025481600)
int(%s)
int(1009843200)
int(1009843200)
int(1009843200)
int(1009839600)
int(1025478000)
int(1025478000)
int(1025481600)
int(1025478000)

--

Hans Werner Strube strube@physik3.gwdg.de
Drittes Physikalisches Institut, Univ. Goettingen
Buergerstr. 42-44, 37073 Goettingen, Germany

Derick Rethans

2004-04-19, 11:33 am

On Mon, 19 Apr 2004, Hans Werner Strube wrote:

>
> I have attached the source files from the zoneinfo directories from our
> Solaris 7 and 8 computers.


This list server killed those, can you please resend those privately to
me?

>
>
> Yes, tested under Solaris 7. But the mktime.phpt test yields some
> differences:


Although it's easier to include the diff, we are aware of this. Just
not the reason why yet.

Derick
Derick Rethans

2004-04-20, 7:32 am

On Tue, 20 Apr 2004, Hans Werner Strube wrote:

>
> Here they are again. But I had also sent my previous mail to you
> directly and just by CC to the list server.


Yeah, I saw that after replying to your mail :)

> Usually, Solaris does not use TZs like Europe/Amsterdam etc. but MET etc.


But MET is only valid for about half of the year due to DST issues so
you HAVE to use the Area/City style method of specifying timezones. Or
is there another way in Slowaris?

regards,
Derick
Hans Werner Strube

2004-04-20, 7:32 am

> But MET is only valid for about half of the year due to DST issues so
> you HAVE to use the Area/City style method of specifying timezones. Or
> is there another way in Slowaris?


As far as I have seen so far, $TZ = MET implies the correct DST treatment
in Solaris (7 and 8). I heard rumors this will be changed in future versions.
Derick Rethans

2004-04-20, 7:33 am

On Tue, 20 Apr 2004, Hans Werner Strube wrote:

>
> As far as I have seen so far, $TZ = MET implies the correct DST treatment
> in Solaris (7 and 8). I heard rumors this will be changed in future versions.


You're right, it works for MET, but not for PDT:

derick@kossu:~$ export TZ=America/Los_Angeles
derick@kossu:~$ date
Tue Apr 20 03:40:47 PDT 2004
derick@kossu:~$ export TZ=PDT
derick@kossu:~$ date
Tue Apr 20 10:41:06 PDT 2004


regards,
Derick
Hans Werner Strube

2004-04-20, 8:30 am

> > As far as I have seen so far, $TZ = MET implies the correct DST treatment
>
> You're right, it works for MET, but not for PDT:
>
> derick@kossu:~$ export TZ=America/Los_Angeles
> derick@kossu:~$ date
> Tue Apr 20 03:40:47 PDT 2004
> derick@kossu:~$ export TZ=PDT
> derick@kossu:~$ date
> Tue Apr 20 10:41:06 PDT 2004


This may merely indicate that there is no file /usr/share/lib/zoneinfo/PDT
in your Solaris installation. (It is also missing in mine, only PST8PDT
exists.) In such a case, GMT is tacitly assumed.
Derick Rethans

2004-04-20, 8:31 am

On Tue, 20 Apr 2004, Hans Werner Strube wrote:

>
> This may merely indicate that there is no file /usr/share/lib/zoneinfo/PDT
> in your Solaris installation. (It is also missing in mine, only PST8PDT
> exists.) In such a case, GMT is tacitly assumed.


Yeah, I know. I also don't have Slowaris, this was on Linux. But I also
don't have a PST8PDT zone file :I I think we need to adjust the tests so
that it checks if a time zone actually exists. It's still weird that
some test reports do show wrong results for the test, even if the
timezone is supported.

regards,
Derick
Hans Werner Strube

2004-04-20, 10:32 am

> It's still weird that
> some test reports do show wrong results for the test, even if the
> timezone is supported.


I repeated the tests in Solaris 7 using
make test TESTS="`echo ext/standard/tests/time/*.phpt`"
and found a single failure only:
FAIL Bug #27780 (strtotime(+1 xxx) returns a wrong date/time) [ext/standard/tests/time/bug27780.phpt]
(the mktime() test was now passed).

Looking at the diff file, this turned out to be not an actual failure but
a different naming of timezones in the Solaris output compared to the
assumed output: CET -> MET, CEST -> MET, IDT -> IST, BRST -> EST,
BRT -> EST. The numerical values were all correct!
Derick Rethans

2004-04-30, 8:30 am

On Tue, 20 Apr 2004, Hans Werner Strube wrote:

>
> I repeated the tests in Solaris 7 using
> make test TESTS="`echo ext/standard/tests/time/*.phpt`"
> and found a single failure only:
> FAIL Bug #27780 (strtotime(+1 xxx) returns a wrong date/time) [ext/standard/tests/time/bug27780.phpt]
> (the mktime() test was now passed).
>
> Looking at the diff file, this turned out to be not an actual failure but
> a different naming of timezones in the Solaris output compared to the
> assumed output: CET -> MET, CEST -> MET, IDT -> IST, BRST -> EST,
> BRT -> EST. The numerical values were all correct!


But CEST should me MEST, not MET and IDT is the DST variant of IST. And
BRST is *definitely* different from EST regarding DST changeover dates
and directions. I do think it's still not a bug in PHP though, but one
in Solaris.

Derick
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com