mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
- Fixed bug #17988: strtotime fails to parse timestamp from postgresql
#- This is actually a feature request
This commit is contained in:
parent
fe1a086d19
commit
77729f89dd
1
NEWS
1
NEWS
@ -41,6 +41,7 @@ PHP NEWS
|
||||
- Fixed bug #22367 (undefined variable has a value). (Zeev)
|
||||
- Fixed bug #19859 (allow fast_call_user_function to support __call).
|
||||
(Stanislav)
|
||||
- Fixed bug #17988 (strtotime failed to parse postgresql timestamp). (Derick)
|
||||
|
||||
29 Jun 2003, PHP 5 Beta 1
|
||||
- Removed the bundled MySQL client library. (Sterling)
|
||||
|
@ -228,6 +228,27 @@ time : tUNUMBER tMERIDIAN {
|
||||
((struct date_yy *)parm)->yyTimezone = -$6 * 60;
|
||||
}
|
||||
}
|
||||
| tUNUMBER ':' tUNUMBER ':' tUNUMBER '.' tUNUMBER pgsqlzonepart {
|
||||
((struct date_yy *)parm)->yyHour = $1;
|
||||
((struct date_yy *)parm)->yyMinutes = $3;
|
||||
((struct date_yy *)parm)->yySeconds = $5;
|
||||
((struct date_yy *)parm)->yyMeridian = MER24;
|
||||
}
|
||||
;
|
||||
|
||||
pgsqlzonepart : tSNUMBER {
|
||||
((struct date_yy *)parm)->yyHaveZone++;
|
||||
if ($1 <= -100 || $1 >= 100) {
|
||||
((struct date_yy *)parm)->yyTimezone =
|
||||
-$1 % 100 + (-$1 / 100) * 60;
|
||||
} else {
|
||||
((struct date_yy *)parm)->yyTimezone = -$1 * 60;
|
||||
}
|
||||
}
|
||||
| zone {
|
||||
((struct date_yy *)parm)->yyHaveZone++;
|
||||
}
|
||||
| /* empty */
|
||||
;
|
||||
|
||||
zone : tZONE {
|
||||
|
33
ext/standard/tests/time/bug17988.phpt
Normal file
33
ext/standard/tests/time/bug17988.phpt
Normal file
@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
Bug #17988 strtotime handling of postgresql timestamps
|
||||
--FILE--
|
||||
<?php
|
||||
putenv("TZ=GMT");
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728 GMT"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728 MET"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728 MEST"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728 EDT"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728-00"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728+00"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728-04"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728+04"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728-0300"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728+0300"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728-0330"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728+0330"))."\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
2002-06-25 14:18:48
|
||||
2002-06-25 14:18:48
|
||||
2002-06-25 13:18:48
|
||||
2002-06-25 12:18:48
|
||||
2002-06-25 18:18:48
|
||||
2002-06-25 14:18:48
|
||||
2002-06-25 14:18:48
|
||||
2002-06-25 18:18:48
|
||||
2002-06-25 10:18:48
|
||||
2002-06-25 17:18:48
|
||||
2002-06-25 11:18:48
|
||||
2002-06-25 17:48:48
|
||||
2002-06-25 10:48:48
|
Loading…
Reference in New Issue
Block a user