In recent version of strptime glibc upstream has fixed a discrepancy between
documentation and actual behaviour by skipping over the sequence that would match %Z.
See http://repo.or.cz/w/glibc.git/commitdiff/
ddc7e412ab252e7360a4357664beb3b5d9c4f42b
So when %Z is used in format
glibc <= 2.18 returns the GMT as unparsed
glibc >= 2.19 returns empty string
Removing %Z from tested format gives the same behavior with all version.
$tstamp = strtotime($input);
$str = strftime("%r %B%e %Y %Z", $tstamp);
-var_dump(strptime($str, '%H:%M:%S %p %B %d %Y %Z'));
+var_dump(strptime($str, '%H:%M:%S %p %B %d %Y'));
$str = strftime("%T %D", $tstamp);
var_dump(strptime($str, '%H:%M:%S %m/%d/%y'));
["tm_yday"]=>
int(182)
["unparsed"]=>
- string(3) "GMT"
+ string(4) " GMT"
}
array(9) {
["tm_sec"]=>