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.
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));
}
--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"));
?>