]> granicus.if.org Git - php/commitdiff
Fix testcases, failing with 'America/New_York' vs. 'US/Eastern' systems
authorMelvyn Sopacua <msopacua@php.net>
Tue, 9 Sep 2003 21:31:51 +0000 (21:31 +0000)
committerMelvyn Sopacua <msopacua@php.net>
Tue, 9 Sep 2003 21:31:51 +0000 (21:31 +0000)
and fallback to POSIX-style. The fallback is based on tzset(3)  manpage [1]
for these systems and may apply to past and future unknowns as well.

Affected systems:   4.4BSD

Possible problem:   OSF

Proposed solution:  leave testcase as is, and if OSF systems start
                    failing during next qa-cycle, always use POSIX style in
                    testcases and add portability note to docs.

# [1] If the TZ environment variable does not specify a tzfile(5)-format
#     file and cannot be interpreted as a direct specification, UTC is
#     used.

ext/standard/tests/time/002.phpt
ext/standard/tests/time/bug13142.phpt

index 1bed70c14cea6921dc7f0f264191fae2f30f4f4c..4aeffac400ef392604d4cd1edb8394a5c1bf89ef 100644 (file)
@@ -33,12 +33,12 @@ if (!@putenv("TZ=EST") || getenv("TZ") != 'EST') {
            echo date ("Y-m-d H:i:s\n", strtotime ($date));
        }
 
-       if (PHP_OS === "OSF1") {
+       putenv("TZ=US/Eastern");
+       if( date("T") == "GMT" ) {
                // POSIX style
                putenv ("TZ=EST5EDT4,M4.1.0,M10.5.0");
-       } else {
-               putenv ("TZ=US/Eastern");
        }
+
        foreach ($dates as $date) {
            echo date ("Y-m-d H:i:s\n", strtotime ($date));
        }
index f021bea6aa18caa899d4ac96a0526e3b8cc8caa8..af3e1f2f316debb4327869e258be51d29aa8e15c 100644 (file)
@@ -9,6 +9,9 @@ if (!@putenv("TZ=US/Eastern") || getenv("TZ") != 'US/Eastern') {
 --FILE--
 <?php
 putenv("TZ=US/Eastern");
+if (date('T') == 'GMT') {
+       putenv("TZ=EST5EDT4,M4.1.0,M10.5.0");
+}
 echo date("r\n", strtotime("Sep 04 16:39:45 2001"));
 echo date("r\n", strtotime("Sep 04 2001 16:39:45"));   
 ?>