bug33415-2.phpt 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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. print "TZ=Africa/Bujumbura - *Note*: Unexpected, as does not appear to
  7. have a DST or timezone transition.\n";
  8. $tStamp = mktime (17, 17, 17, 1, 1, 1970);
  9. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  10. $strtotime_tstamp = strtotime("next Wednesday", $tStamp);
  11. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  12. print "wanted=Wednesday 00:00:00\n\n";
  13. print "TZ=Asia/Thimbu - Is it OK for this to be 0:30 AM? yes\n";
  14. date_default_timezone_set('Asia/Thimbu');
  15. $tStamp = mktime (17, 17, 17, 1, 6476, 1970);
  16. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  17. $strtotime_tstamp = strtotime("next Thursday", $tStamp);
  18. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  19. print "wanted=Thursday 00:30:00\n\n";
  20. print "TZ=Indian/Cocos - Is it OK for this to be 6:30 AM? Note: does not
  21. appear to have a DST or timezone transition.\n";
  22. date_default_timezone_set('Indian/Cocos');
  23. $tStamp = mktime (17, 17, 17, 1, 1, 1970);
  24. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  25. $strtotime_tstamp = strtotime("next Thursday", $tStamp);
  26. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  27. print "wanted=Thursday 00:00:00\n\n";
  28. print "TZ=Africa/Lubumbashi - Is it OK for this to be 2 AM? Note: does
  29. not appear to have a DST or timezone transition.\n";
  30. date_default_timezone_set('Africa/Lubumbashi');
  31. $tStamp = mktime (17, 17, 17, 1, 1, 1970);
  32. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  33. $strtotime_tstamp = strtotime("next Saturday", $tStamp);
  34. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  35. print "wanted=Saturday 00:00:00\n\n";
  36. print "TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes\n";
  37. date_default_timezone_set('Asia/Kashgar');
  38. $tStamp = mktime (17, 17, 17, 1, 3767, 1970);
  39. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  40. $strtotime_tstamp = strtotime("next Thursday", $tStamp);
  41. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  42. print "wanted=Thursday 03:00:00\n\n";
  43. print "TZ=Indian/Christmas - Is it OK for this to be 7 AM? Note: does
  44. not appear to have a DST or timezone transition.\n";
  45. date_default_timezone_set('Indian/Christmas');
  46. $tStamp = mktime (17, 17, 17, 1, 1, 1970);
  47. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  48. $strtotime_tstamp = strtotime("next Sunday", $tStamp);
  49. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  50. print "wanted=Sunday 00:00:00\n\n";
  51. print "TZ=America/Santo_Domingo - Is it OK for this to be 0:30 AM? yes\n";
  52. date_default_timezone_set('America/Santo_Domingo');
  53. $tStamp = mktime (17, 17, 17, 1, 291, 1970);
  54. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  55. $strtotime_tstamp = strtotime("next Sunday", $tStamp);
  56. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  57. print "wanted=Sunday 00:30:00\n\n";
  58. print "TZ=Pacific/Truk - Is it OK for this to be 10 AM? Note: does not
  59. appear to have a DST or timezone transition.\n";
  60. date_default_timezone_set('Pacific/Truk');
  61. $tStamp = mktime (17, 17, 17, 1, 1, 1970);
  62. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  63. $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
  64. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  65. print "wanted=Tuesday 00:00:00\n\n";
  66. print "TZ=Pacific/Ponape - Is it OK for this to be 11 AM? Note: does
  67. not appear to have a DST or timezone transition.\n";
  68. date_default_timezone_set('Pacific/Ponape');
  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 Monday", $tStamp);
  72. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  73. print "wanted=Monday 00:00:00\n\n";
  74. print "TZ=America/Scoresbysund - Is it OK for this to be 2 AM? yes\n";
  75. date_default_timezone_set('America/Scoresbysund');
  76. $tStamp = mktime (17, 17, 17, 1, 4099, 1970);
  77. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  78. $strtotime_tstamp = strtotime("next Sunday", $tStamp);
  79. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  80. print "wanted=Sunday 02:00:00\n\n";
  81. print "TZ=Asia/Tehran - Is it OK for this to be 0:30 AM? yes\n";
  82. date_default_timezone_set('Asia/Tehran');
  83. $tStamp = mktime (17, 17, 17, 1, 2855, 1970);
  84. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  85. $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
  86. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  87. print "wanted=Tuesday 00:00:00\n\n";
  88. print "TZ=Pacific/Tarawa - Is it OK for this to be Midday? Note: does
  89. not appear to have a DST or timezone transition.\n";
  90. date_default_timezone_set('Pacific/Tarawa');
  91. $tStamp = mktime (17, 17, 17, 1, 1, 1970);
  92. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  93. $strtotime_tstamp = strtotime("next Monday", $tStamp);
  94. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  95. print "wanted=Monday 00:00:00\n\n";
  96. print "TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes\n";
  97. date_default_timezone_set('Africa/Monrovia');
  98. $tStamp = mktime (17, 17, 17, 1, 730, 1970);
  99. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  100. $strtotime_tstamp = strtotime("next Friday", $tStamp);
  101. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  102. print "wanted=Friday 00:44:30\n\n";
  103. print "TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes\n";
  104. date_default_timezone_set('Asia/Katmandu');
  105. $tStamp = mktime (17, 17, 17, 1, 5838, 1970);
  106. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  107. $strtotime_tstamp = strtotime("next Wednesday", $tStamp);
  108. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  109. print "wanted=Wednesday 00:15:00\n\n";
  110. print "TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes\n";
  111. date_default_timezone_set('Pacific/Nauru');
  112. $tStamp = mktime (17, 17, 17, 2, 3, 1979);
  113. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  114. $strtotime_tstamp = strtotime("next Saturday +2 hours", $tStamp);
  115. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  116. print "wanted=Saturday 02:30:00\n\n";
  117. print "TZ=Pacific/Port_Moresby - Is it OK for this to be 10 AM? No DST
  118. or timezone transition.\n";
  119. date_default_timezone_set('Pacific/Port_Moresby');
  120. $tStamp = mktime (17, 17, 17, 1, 1, 1970);
  121. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  122. $strtotime_tstamp = strtotime("next Thursday", $tStamp);
  123. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  124. print "wanted=Thursday 00:00:00\n\n";
  125. print "TZ=America/Miquelon - Is it OK for this to be 1 AM ? yes\n";
  126. date_default_timezone_set('America/Miquelon');
  127. $tStamp = mktime (17, 17, 17, 1, 3767, 1970);
  128. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  129. $strtotime_tstamp = strtotime("next Thursday", $tStamp);
  130. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  131. print "wanted=Thursday 01:00:00\n\n";
  132. print "TZ=Pacific/Palau - Is it OK for this to be 9 AM? No DST or
  133. timezone transition.\n";
  134. date_default_timezone_set('Pacific/Palau');
  135. $tStamp = mktime (17, 17, 17, 1, 1, 1970);
  136. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  137. $strtotime_tstamp = strtotime("next Saturday", $tStamp);
  138. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  139. print "wanted=Saturday 00:00:00\n\n";
  140. print "TZ=Pacific/Funafuti - Is it OK for this to be midday? Note: does
  141. not appear to have a DST or timezone transition.\n";
  142. date_default_timezone_set('Pacific/Funafuti');
  143. $tStamp = mktime (17, 17, 17, 1, 1, 1970);
  144. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  145. $strtotime_tstamp = strtotime("next Wednesday", $tStamp);
  146. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  147. print "wanted=Wednesday 00:00:00\n\n";
  148. print "TZ=Pacific/Wake - Is it OK for this to be midday? Note: does not
  149. appear to have a DST or timezone transition.\n";
  150. date_default_timezone_set('Pacific/Wake');
  151. $tStamp = mktime (17, 17, 17, 1, 1, 1970);
  152. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  153. $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
  154. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  155. print "wanted=Tuesday 00:00:00\n\n";
  156. print "TZ=Pacific/Wallis - Is it OK for this to be midday? Note: does
  157. not appear to have a DST or timezone transition.\n";
  158. date_default_timezone_set('Pacific/Wallis');
  159. $tStamp = mktime (17, 17, 17, 1, 1, 1970);
  160. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  161. $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
  162. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  163. print "wanted=Tuesday 00:00:00\n\n";
  164. print "TZ=America/Paramaribo - Is it OK for this to be 0:30 AM? yes\n";
  165. date_default_timezone_set('America/Paramaribo');
  166. $tStamp = mktime (17, 17, 17, 1, 5381, 1970);
  167. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  168. $strtotime_tstamp = strtotime("next Monday", $tStamp);
  169. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  170. print "wanted=Monday 00:30:00\n\n";
  171. ?>
  172. --EXPECT--
  173. TZ=Africa/Bujumbura - *Note*: Unexpected, as does not appear to
  174. have a DST or timezone transition.
  175. tStamp=Thursday 1970-01-01 17:17:17 CAT 0
  176. result=Wednesday 1970-01-07 00:00:00 CAT 0
  177. wanted=Wednesday 00:00:00
  178. TZ=Asia/Thimbu - Is it OK for this to be 0:30 AM? yes
  179. tStamp=Thursday 1987-09-24 17:17:17 +0530 0
  180. result=Thursday 1987-10-01 00:30:00 +06 0
  181. wanted=Thursday 00:30:00
  182. TZ=Indian/Cocos - Is it OK for this to be 6:30 AM? Note: does not
  183. appear to have a DST or timezone transition.
  184. tStamp=Thursday 1970-01-01 17:17:17 +0630 0
  185. result=Thursday 1970-01-08 00:00:00 +0630 0
  186. wanted=Thursday 00:00:00
  187. TZ=Africa/Lubumbashi - Is it OK for this to be 2 AM? Note: does
  188. not appear to have a DST or timezone transition.
  189. tStamp=Thursday 1970-01-01 17:17:17 CAT 0
  190. result=Saturday 1970-01-03 00:00:00 CAT 0
  191. wanted=Saturday 00:00:00
  192. TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes
  193. tStamp=Thursday 1980-04-24 17:17:17 +06 0
  194. result=Thursday 1980-05-01 00:00:00 +06 0
  195. wanted=Thursday 03:00:00
  196. TZ=Indian/Christmas - Is it OK for this to be 7 AM? Note: does
  197. not appear to have a DST or timezone transition.
  198. tStamp=Thursday 1970-01-01 17:17:17 +07 0
  199. result=Sunday 1970-01-04 00:00:00 +07 0
  200. wanted=Sunday 00:00:00
  201. TZ=America/Santo_Domingo - Is it OK for this to be 0:30 AM? yes
  202. tStamp=Sunday 1970-10-18 17:17:17 EST 0
  203. result=Sunday 1970-10-25 00:30:00 -0430 1
  204. wanted=Sunday 00:30:00
  205. TZ=Pacific/Truk - Is it OK for this to be 10 AM? Note: does not
  206. appear to have a DST or timezone transition.
  207. tStamp=Thursday 1970-01-01 17:17:17 +10 0
  208. result=Tuesday 1970-01-06 00:00:00 +10 0
  209. wanted=Tuesday 00:00:00
  210. TZ=Pacific/Ponape - Is it OK for this to be 11 AM? Note: does
  211. not appear to have a DST or timezone transition.
  212. tStamp=Thursday 1970-01-01 17:17:17 +11 0
  213. result=Monday 1970-01-05 00:00:00 +11 0
  214. wanted=Monday 00:00:00
  215. TZ=America/Scoresbysund - Is it OK for this to be 2 AM? yes
  216. tStamp=Sunday 1981-03-22 17:17:17 -02 0
  217. result=Sunday 1981-03-29 02:00:00 +00 1
  218. wanted=Sunday 02:00:00
  219. TZ=Asia/Tehran - Is it OK for this to be 0:30 AM? yes
  220. tStamp=Tuesday 1977-10-25 17:17:17 +04 0
  221. result=Tuesday 1977-11-01 00:00:00 +04 0
  222. wanted=Tuesday 00:00:00
  223. TZ=Pacific/Tarawa - Is it OK for this to be Midday? Note: does
  224. not appear to have a DST or timezone transition.
  225. tStamp=Thursday 1970-01-01 17:17:17 +12 0
  226. result=Monday 1970-01-05 00:00:00 +12 0
  227. wanted=Monday 00:00:00
  228. TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes
  229. tStamp=Friday 1971-12-31 17:17:17 MMT 0
  230. result=Friday 1972-01-07 00:44:30 GMT 0
  231. wanted=Friday 00:44:30
  232. TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes
  233. tStamp=Wednesday 1985-12-25 17:17:17 +0530 0
  234. result=Wednesday 1986-01-01 00:15:00 +0545 0
  235. wanted=Wednesday 00:15:00
  236. TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes
  237. tStamp=Saturday 1979-02-03 17:17:17 +1130 0
  238. result=Saturday 1979-02-10 02:30:00 +12 0
  239. wanted=Saturday 02:30:00
  240. TZ=Pacific/Port_Moresby - Is it OK for this to be 10 AM? No DST
  241. or timezone transition.
  242. tStamp=Thursday 1970-01-01 17:17:17 +10 0
  243. result=Thursday 1970-01-08 00:00:00 +10 0
  244. wanted=Thursday 00:00:00
  245. TZ=America/Miquelon - Is it OK for this to be 1 AM ? yes
  246. tStamp=Thursday 1980-04-24 17:17:17 AST 0
  247. result=Thursday 1980-05-01 01:00:00 -03 0
  248. wanted=Thursday 01:00:00
  249. TZ=Pacific/Palau - Is it OK for this to be 9 AM? No DST or
  250. timezone transition.
  251. tStamp=Thursday 1970-01-01 17:17:17 +09 0
  252. result=Saturday 1970-01-03 00:00:00 +09 0
  253. wanted=Saturday 00:00:00
  254. TZ=Pacific/Funafuti - Is it OK for this to be midday? Note: does
  255. not appear to have a DST or timezone transition.
  256. tStamp=Thursday 1970-01-01 17:17:17 +12 0
  257. result=Wednesday 1970-01-07 00:00:00 +12 0
  258. wanted=Wednesday 00:00:00
  259. TZ=Pacific/Wake - Is it OK for this to be midday? Note: does not
  260. appear to have a DST or timezone transition.
  261. tStamp=Thursday 1970-01-01 17:17:17 +12 0
  262. result=Tuesday 1970-01-06 00:00:00 +12 0
  263. wanted=Tuesday 00:00:00
  264. TZ=Pacific/Wallis - Is it OK for this to be midday? Note: does
  265. not appear to have a DST or timezone transition.
  266. tStamp=Thursday 1970-01-01 17:17:17 +12 0
  267. result=Tuesday 1970-01-06 00:00:00 +12 0
  268. wanted=Tuesday 00:00:00
  269. TZ=America/Paramaribo - Is it OK for this to be 0:30 AM? yes
  270. tStamp=Monday 1984-09-24 17:17:17 -0330 0
  271. result=Monday 1984-10-01 00:30:00 -03 0
  272. wanted=Monday 00:30:00