Annotation of embedaddon/php/ext/date/tests/bug40861.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #40861 (Multiple +/- on relative units breaks strtotime())
! 3: --FILE--
! 4: <?php
! 5: date_default_timezone_set("GMT");
! 6:
! 7: $offset = +60;
! 8: $ts = strtotime('2000-01-01 12:00:00');
! 9: $result = date("Y-m-d H:i:s", strtotime("+$offset minutes", $ts));
! 10: echo $result . "\n";
! 11:
! 12: $offset = -60;
! 13: $ts = strtotime('2000-01-01 12:00:00');
! 14: $result = date("Y-m-d H:i:s", strtotime("+$offset minutes", $ts));
! 15: echo $result . "\n";
! 16:
! 17: $offset = -60;
! 18: $ts = strtotime('2000-01-01 12:00:00');
! 19: $result = date("Y-m-d H:i:s", strtotime("-$offset minutes", $ts));
! 20: echo $result . "\n";
! 21:
! 22:
! 23: $offset = 60;
! 24: $ts = strtotime('2000-01-01 12:00:00');
! 25: $result = date("Y-m-d H:i:s", strtotime("+$offset minutes", $ts));
! 26: echo $result . "\n";
! 27:
! 28: ?>
! 29: --EXPECT--
! 30: 2000-01-01 13:00:00
! 31: 2000-01-01 11:00:00
! 32: 2000-01-01 13:00:00
! 33: 2000-01-01 13:00:00
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>