Annotation of embedaddon/php/ext/date/tests/bug27719.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #27719 (mktime returns incorrect timestamp for dst days)
! 3: --INI--
! 4: date.timezone=EST
! 5: error_reporting=2047
! 6: --FILE--
! 7: <?php /* $Id: bug27719.phpt 280398 2009-05-12 19:46:58Z felipe $ */
! 8: $a = mktime(0, 0, 0, 4, 4, 2004, 0);
! 9: $b = mktime(0, 0, 0, 4, 4, 2004, 1);
! 10: $c = mktime(0, 0, 0, 4, 4, 2004, -1);
! 11: echo "$a ".date("m/d/y h:i:s\n",$a);
! 12: echo "$b ".date("m/d/y h:i:s\n",$b);
! 13: echo "$c ".date("m/d/y h:i:s\n",$c);
! 14: echo "\n";
! 15: date_default_timezone_set('EST5EDT'); // DST not in effect
! 16: $a = mktime(0, 0, 0, 2, 4, 2004, 0);
! 17: $b = mktime(0, 0, 0, 2, 4, 2004, 1);
! 18: $c = mktime(0, 0, 0, 2, 4, 2004, -1);
! 19: echo "$a ".date("m/d/y h:i:s\n",$a);
! 20: echo "$b ".date("m/d/y h:i:s\n",$b);
! 21: echo "$c ".date("m/d/y h:i:s\n",$c);
! 22: echo "\n";
! 23: date_default_timezone_set('EST5EDT');
! 24: $a = mktime(0, 0, 0, 4, 4, 2004, 0);
! 25: $b = mktime(0, 0, 0, 4, 4, 2004, 1);
! 26: $c = mktime(0, 0, 0, 4, 4, 2004, -1);
! 27: echo "$a ".date("m/d/y h:i:s\n",$a);
! 28: echo "$b ".date("m/d/y h:i:s\n",$b);
! 29: echo "$c ".date("m/d/y h:i:s\n",$c);
! 30: echo "\n";
! 31: date_default_timezone_set('EST5EDT');
! 32: $a = mktime(3, 0, 0, 4, 4, 2004, 0);
! 33: $b = mktime(3, 0, 0, 4, 4, 2004, 1);
! 34: $c = mktime(3, 0, 0, 4, 4, 2004, -1);
! 35: echo "$a ".date("m/d/y h:i:s\n",$a);
! 36: echo "$b ".date("m/d/y h:i:s\n",$b);
! 37: echo "$c ".date("m/d/y h:i:s\n",$c);
! 38: echo "\n";
! 39: date_default_timezone_set('EST5EDT');
! 40: $a = mktime(0, 0, 0, 6, 4, 2004, 0);
! 41: $b = mktime(0, 0, 0, 6, 4, 2004, 1);
! 42: $c = mktime(0, 0, 0, 6, 4, 2004, -1);
! 43: echo "$a ".date("m/d/y h:i:s\n",$a);
! 44: echo "$b ".date("m/d/y h:i:s\n",$b);
! 45: echo "$c ".date("m/d/y h:i:s\n",$c);
! 46: echo "\n";
! 47: ?>
! 48: --EXPECTF--
! 49: 1081054800 04/04/04 12:00:00
! 50: %s
! 51: 1081054800 04/04/04 12:00:00
! 52:
! 53: 1075870800 02/04/04 12:00:00
! 54: 1075867200 02/03/04 11:00:00
! 55: 1075870800 02/04/04 12:00:00
! 56:
! 57: 1081054800 04/04/04 12:00:00
! 58: 1081051200 04/03/04 11:00:00
! 59: 1081054800 04/04/04 12:00:00
! 60:
! 61: 1081065600 04/04/04 04:00:00
! 62: 1081062000 04/04/04 03:00:00
! 63: 1081062000 04/04/04 03:00:00
! 64:
! 65: 1086325200 06/04/04 01:00:00
! 66: 1086321600 06/04/04 12:00:00
! 67: 1086321600 06/04/04 12:00:00
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>