Annotation of embedaddon/php/ext/date/tests/bug33415-2.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #33415 [2] (Possibly invalid non-one-hour DST or timezone shifts)
                      3: --FILE--
                      4: <?php
                      5: date_default_timezone_set('Africa/Bujumbura');
                      6: 
                      7: print "TZ=Africa/Bujumbura - *Note*: Unexpected, as does not appear to
                      8: have a DST or timezone transition.\n";
                      9: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
                     10: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                     11: $strtotime_tstamp = strtotime("next Wednesday", $tStamp);
                     12: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                     13: print "wanted=Wednesday            00:00:00\n\n";
                     14: 
                     15: print "TZ=Asia/Thimbu - Is it OK for this to be 0:30 AM? yes\n";
                     16: date_default_timezone_set('Asia/Thimbu');
                     17: $tStamp = mktime (17, 17, 17, 1, 6476, 1970);
                     18: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                     19: $strtotime_tstamp = strtotime("next Thursday", $tStamp);
                     20: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                     21: print "wanted=Thursday            00:30:00\n\n";
                     22: 
                     23: print "TZ=Indian/Cocos - Is it OK for this to be 6:30 AM? Note: does not
                     24: appear to have a DST or timezone transition.\n";
                     25: date_default_timezone_set('Indian/Cocos');
                     26: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
                     27: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                     28: $strtotime_tstamp = strtotime("next Thursday", $tStamp);
                     29: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                     30: print "wanted=Thursday            00:00:00\n\n";
                     31: 
                     32: print "TZ=Africa/Lubumbashi - Is it OK for this to be 2 AM? Note: does
                     33: not appear to have a DST or timezone transition.\n";
                     34: date_default_timezone_set('Africa/Lubumbashi');
                     35: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
                     36: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                     37: $strtotime_tstamp = strtotime("next Saturday", $tStamp);
                     38: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                     39: print "wanted=Saturday            00:00:00\n\n";
                     40: 
                     41: print "TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes\n";
                     42: date_default_timezone_set('Asia/Kashgar');
                     43: $tStamp = mktime (17, 17, 17, 1, 3767, 1970);
                     44: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                     45: $strtotime_tstamp = strtotime("next Thursday", $tStamp);
                     46: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                     47: print "wanted=Thursday            03:00:00\n\n";
                     48: 
                     49: print "TZ=Indian/Christmas - Is it OK for this to be 7 AM?  Note: does
                     50: not appear to have a DST or timezone transition.\n";
                     51: date_default_timezone_set('Indian/Christmas');
                     52: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
                     53: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                     54: $strtotime_tstamp = strtotime("next Sunday", $tStamp);
                     55: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                     56: print "wanted=Sunday            00:00:00\n\n";
                     57: 
                     58: print "TZ=America/Santo_Domingo - Is it OK for this to be 0:30 AM? yes\n";
                     59: date_default_timezone_set('America/Santo_Domingo');
                     60: $tStamp = mktime (17, 17, 17, 1, 291, 1970);
                     61: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                     62: $strtotime_tstamp = strtotime("next Sunday", $tStamp);
                     63: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                     64: print "wanted=Sunday            00:30:00\n\n";
                     65: 
                     66: print "TZ=Pacific/Truk - Is it OK for this to be 10 AM?  Note: does not
                     67: appear to have a DST or timezone transition.\n";
                     68: date_default_timezone_set('Pacific/Truk');
                     69: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
                     70: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                     71: $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
                     72: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                     73: print "wanted=Tuesday            00:00:00\n\n";
                     74: 
                     75: print "TZ=Pacific/Ponape - Is it OK for this to be 11 AM?  Note: does
                     76: not appear to have a DST or timezone transition.\n";
                     77: date_default_timezone_set('Pacific/Ponape');
                     78: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
                     79: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                     80: $strtotime_tstamp = strtotime("next Monday", $tStamp);
                     81: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                     82: print "wanted=Monday            00:00:00\n\n";
                     83: 
                     84: print "TZ=America/Scoresbysund - Is it OK for this to be 2 AM? yes\n";
                     85: date_default_timezone_set('America/Scoresbysund');
                     86: $tStamp = mktime (17, 17, 17, 1, 4099, 1970);
                     87: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                     88: $strtotime_tstamp = strtotime("next Sunday", $tStamp);
                     89: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                     90: print "wanted=Sunday            02:00:00\n\n";
                     91: 
                     92: print "TZ=America/Guyana - Is it OK for this to be 0:45 AM? yes\n";
                     93: date_default_timezone_set('America/Guyana');
                     94: $tStamp = mktime (17, 17, 17, 1, 2031, 1970);
                     95: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                     96: $strtotime_tstamp = strtotime("next Thursday", $tStamp);
                     97: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                     98: print "wanted=Thursday            00:45:00\n\n";
                     99: 
                    100: print "TZ=Asia/Tehran - Is it OK for this to be 0:30 AM? yes\n";
                    101: date_default_timezone_set('Asia/Tehran');
                    102: $tStamp = mktime (17, 17, 17, 1, 2855, 1970);
                    103: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                    104: $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
                    105: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                    106: print "wanted=Tuesday            00:30:00\n\n";
                    107: 
                    108: print "TZ=Pacific/Tarawa - Is it OK for this to be Midday? Note: does
                    109: not appear to have a DST or timezone transition.\n";     
                    110: date_default_timezone_set('Pacific/Tarawa');
                    111: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
                    112: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                    113: $strtotime_tstamp = strtotime("next Monday", $tStamp);
                    114: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                    115: print "wanted=Monday            00:00:00\n\n";
                    116: 
                    117: print "TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes\n";
                    118: date_default_timezone_set('Africa/Monrovia');
                    119: $tStamp = mktime (17, 17, 17, 1, 845, 1970);
                    120: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                    121: $strtotime_tstamp = strtotime("next Monday", $tStamp);
                    122: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                    123: print "wanted=Monday            00:44:30\n\n";
                    124: 
                    125: print "TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes\n";
                    126: date_default_timezone_set('Asia/Katmandu');
                    127: $tStamp = mktime (17, 17, 17, 1, 5838, 1970);
                    128: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                    129: $strtotime_tstamp = strtotime("next Wednesday", $tStamp);
                    130: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                    131: print "wanted=Wednesday            00:15:00\n\n";         
                    132: 
                    133: print "TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes\n";
                    134: date_default_timezone_set('Pacific/Nauru');
                    135: $tStamp = mktime (17, 17, 17, 1, 3401, 1970);
                    136: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                    137: $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
                    138: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                    139: print "wanted=Tuesday            00:30:00\n\n";
                    140: 
                    141: print "TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes\n";
                    142: date_default_timezone_set('Pacific/Niue');
                    143: $tStamp = mktime (17, 17, 17, 1, 3189, 1970);
                    144: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                    145: $strtotime_tstamp = strtotime("next Sunday", $tStamp);
                    146: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                    147: print "wanted=Sunday            00:30:00\n\n";            
                    148: 
                    149: print "TZ=Pacific/Port_Moresby - Is it OK for this to be 10 AM? No DST
                    150: or timezone transition.\n";
                    151: date_default_timezone_set('Pacific/Port_Moresby');
                    152: $tStamp = mktime (17, 17, 17, 1, 1, 1970);   
                    153: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                    154: $strtotime_tstamp = strtotime("next Thursday", $tStamp); 
                    155: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                    156: print "wanted=Thursday            00:00:00\n\n";          
                    157: 
                    158: print "TZ=America/Miquelon - Is it OK for this to be 1 AM ? yes\n";
                    159: date_default_timezone_set('America/Miquelon');
                    160: $tStamp = mktime (17, 17, 17, 1, 3767, 1970);
                    161: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                    162: $strtotime_tstamp = strtotime("next Thursday", $tStamp);
                    163: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                    164: print "wanted=Thursday            01:00:00\n\n";
                    165: 
                    166: print "TZ=Pacific/Palau - Is it OK for this to be 9 AM? No DST or
                    167: timezone transition.\n";
                    168: date_default_timezone_set('Pacific/Palau');
                    169: $tStamp = mktime (17, 17, 17, 1, 1, 1970);   
                    170: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                    171: $strtotime_tstamp = strtotime("next Saturday", $tStamp);
                    172: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                    173: print "wanted=Saturday            00:00:00\n\n";
                    174: 
                    175: print "TZ=Pacific/Funafuti - Is it OK for this to be midday?  Note: does
                    176: not appear to have a DST or timezone transition.\n";
                    177: date_default_timezone_set('Pacific/Funafuti');
                    178: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
                    179: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                    180: $strtotime_tstamp = strtotime("next Wednesday", $tStamp);
                    181: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                    182: print "wanted=Wednesday            00:00:00\n\n";
                    183: 
                    184: print "TZ=Pacific/Wake - Is it OK for this to be midday?  Note: does not
                    185: appear to have a DST or timezone transition.\n";
                    186: date_default_timezone_set('Pacific/Wake');
                    187: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
                    188: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                    189: $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
                    190: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                    191: print "wanted=Tuesday            00:00:00\n\n";
                    192: 
                    193: print "TZ=Pacific/Wallis - Is it OK for this to be midday?  Note: does
                    194: not appear to have a DST or timezone transition.\n";
                    195: date_default_timezone_set('Pacific/Wallis');
                    196: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
                    197: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                    198: $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
                    199: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                    200: print "wanted=Tuesday            00:00:00\n\n";
                    201: 
                    202: print "TZ=America/Paramaribo - Is it OK for this to be 0:30 AM? yes\n";
                    203: date_default_timezone_set('America/Paramaribo');
                    204: $tStamp = mktime (17, 17, 17, 1, 5381, 1970);
                    205: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
                    206: $strtotime_tstamp = strtotime("next Monday", $tStamp);
                    207: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
                    208: print "wanted=Monday            00:30:00\n\n";
                    209: 
                    210: ?>
                    211: --EXPECT--
                    212: TZ=Africa/Bujumbura - *Note*: Unexpected, as does not appear to
                    213: have a DST or timezone transition.
                    214: tStamp=Thursday 1970-01-01 17:17:17 CAT 0
                    215: result=Wednesday 1970-01-07 00:00:00 CAT 0
                    216: wanted=Wednesday            00:00:00
                    217: 
                    218: TZ=Asia/Thimbu - Is it OK for this to be 0:30 AM? yes
                    219: tStamp=Thursday 1987-09-24 17:17:17 IST 0
                    220: result=Thursday 1987-10-01 00:30:00 BTT 0
                    221: wanted=Thursday            00:30:00
                    222: 
                    223: TZ=Indian/Cocos - Is it OK for this to be 6:30 AM? Note: does not
                    224: appear to have a DST or timezone transition.
                    225: tStamp=Thursday 1970-01-01 17:17:17 CCT 0
                    226: result=Thursday 1970-01-08 00:00:00 CCT 0
                    227: wanted=Thursday            00:00:00
                    228: 
                    229: TZ=Africa/Lubumbashi - Is it OK for this to be 2 AM? Note: does
                    230: not appear to have a DST or timezone transition.
                    231: tStamp=Thursday 1970-01-01 17:17:17 CAT 0
                    232: result=Saturday 1970-01-03 00:00:00 CAT 0
                    233: wanted=Saturday            00:00:00
                    234: 
                    235: TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes
                    236: tStamp=Thursday 1980-04-24 17:17:17 KAST 0
                    237: result=Thursday 1980-05-01 03:00:00 CST 0
                    238: wanted=Thursday            03:00:00
                    239: 
                    240: TZ=Indian/Christmas - Is it OK for this to be 7 AM?  Note: does
                    241: not appear to have a DST or timezone transition.
                    242: tStamp=Thursday 1970-01-01 17:17:17 CXT 0
                    243: result=Sunday 1970-01-04 00:00:00 CXT 0
                    244: wanted=Sunday            00:00:00
                    245: 
                    246: TZ=America/Santo_Domingo - Is it OK for this to be 0:30 AM? yes
                    247: tStamp=Sunday 1970-10-18 17:17:17 EST 0
                    248: result=Sunday 1970-10-25 00:30:00 EHDT 1
                    249: wanted=Sunday            00:30:00
                    250: 
                    251: TZ=Pacific/Truk - Is it OK for this to be 10 AM?  Note: does not
                    252: appear to have a DST or timezone transition.
                    253: tStamp=Thursday 1970-01-01 17:17:17 CHUT 0
                    254: result=Tuesday 1970-01-06 00:00:00 CHUT 0
                    255: wanted=Tuesday            00:00:00
                    256: 
                    257: TZ=Pacific/Ponape - Is it OK for this to be 11 AM?  Note: does
                    258: not appear to have a DST or timezone transition.
                    259: tStamp=Thursday 1970-01-01 17:17:17 PONT 0
                    260: result=Monday 1970-01-05 00:00:00 PONT 0
                    261: wanted=Monday            00:00:00
                    262: 
                    263: TZ=America/Scoresbysund - Is it OK for this to be 2 AM? yes
                    264: tStamp=Sunday 1981-03-22 17:17:17 CGT 0
                    265: result=Sunday 1981-03-29 02:00:00 EGST 1
                    266: wanted=Sunday            02:00:00
                    267: 
                    268: TZ=America/Guyana - Is it OK for this to be 0:45 AM? yes
                    269: tStamp=Thursday 1975-07-24 17:17:17 GYT 0
                    270: result=Thursday 1975-07-31 00:45:00 GYT 0
                    271: wanted=Thursday            00:45:00
                    272: 
                    273: TZ=Asia/Tehran - Is it OK for this to be 0:30 AM? yes
                    274: tStamp=Tuesday 1977-10-25 17:17:17 IRST 0
                    275: result=Tuesday 1977-11-01 00:30:00 IRST 0
                    276: wanted=Tuesday            00:30:00
                    277: 
                    278: TZ=Pacific/Tarawa - Is it OK for this to be Midday? Note: does
                    279: not appear to have a DST or timezone transition.
                    280: tStamp=Thursday 1970-01-01 17:17:17 GILT 0
                    281: result=Monday 1970-01-05 00:00:00 GILT 0
                    282: wanted=Monday            00:00:00
                    283: 
                    284: TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes
                    285: tStamp=Monday 1972-04-24 17:17:17 LRT 0
                    286: result=Monday 1972-05-01 00:44:30 GMT 0
                    287: wanted=Monday            00:44:30
                    288: 
                    289: TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes
                    290: tStamp=Wednesday 1985-12-25 17:17:17 IST 0
                    291: result=Wednesday 1986-01-01 00:15:00 NPT 0
                    292: wanted=Wednesday            00:15:00
                    293: 
                    294: TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes
                    295: tStamp=Tuesday 1979-04-24 17:17:17 NRT 0
                    296: result=Tuesday 1979-05-01 00:30:00 NRT 0
                    297: wanted=Tuesday            00:30:00
                    298: 
                    299: TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes
                    300: tStamp=Sunday 1978-09-24 17:17:17 NUT 0
                    301: result=Sunday 1978-10-01 00:30:00 NUT 0
                    302: wanted=Sunday            00:30:00
                    303: 
                    304: TZ=Pacific/Port_Moresby - Is it OK for this to be 10 AM? No DST
                    305: or timezone transition.
                    306: tStamp=Thursday 1970-01-01 17:17:17 PGT 0
                    307: result=Thursday 1970-01-08 00:00:00 PGT 0
                    308: wanted=Thursday            00:00:00
                    309: 
                    310: TZ=America/Miquelon - Is it OK for this to be 1 AM ? yes
                    311: tStamp=Thursday 1980-04-24 17:17:17 AST 0
                    312: result=Thursday 1980-05-01 01:00:00 PMST 0
                    313: wanted=Thursday            01:00:00
                    314: 
                    315: TZ=Pacific/Palau - Is it OK for this to be 9 AM? No DST or
                    316: timezone transition.
                    317: tStamp=Thursday 1970-01-01 17:17:17 PWT 0
                    318: result=Saturday 1970-01-03 00:00:00 PWT 0
                    319: wanted=Saturday            00:00:00
                    320: 
                    321: TZ=Pacific/Funafuti - Is it OK for this to be midday?  Note: does
                    322: not appear to have a DST or timezone transition.
                    323: tStamp=Thursday 1970-01-01 17:17:17 TVT 0
                    324: result=Wednesday 1970-01-07 00:00:00 TVT 0
                    325: wanted=Wednesday            00:00:00
                    326: 
                    327: TZ=Pacific/Wake - Is it OK for this to be midday?  Note: does not
                    328: appear to have a DST or timezone transition.
                    329: tStamp=Thursday 1970-01-01 17:17:17 WAKT 0
                    330: result=Tuesday 1970-01-06 00:00:00 WAKT 0
                    331: wanted=Tuesday            00:00:00
                    332: 
                    333: TZ=Pacific/Wallis - Is it OK for this to be midday?  Note: does
                    334: not appear to have a DST or timezone transition.
                    335: tStamp=Thursday 1970-01-01 17:17:17 WFT 0
                    336: result=Tuesday 1970-01-06 00:00:00 WFT 0
                    337: wanted=Tuesday            00:00:00
                    338: 
                    339: TZ=America/Paramaribo - Is it OK for this to be 0:30 AM? yes
                    340: tStamp=Monday 1984-09-24 17:17:17 SRT 0
                    341: result=Monday 1984-10-01 00:30:00 SRT 0
                    342: wanted=Monday            00:30:00

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>