bug33414-1.phpt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. --TEST--
  2. Bug #33414 [1] (Comprehensive list of incorrect days returned after strotime() / date() tests)
  3. --INI--
  4. date.timezone=America/Mendoza
  5. --FILE--
  6. <?php
  7. print "TZ=America/Mendoza - wrong day.\n";
  8. $tStamp = mktime (17, 17, 17, 1, 8327, 1970);
  9. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  10. $strtotime_tstamp = strtotime("next Sunday", $tStamp);
  11. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  12. print "wanted=Sunday 00:00:00\n\n";
  13. print "TZ=America/Catamarca - wrong day.\n";
  14. date_default_timezone_set("America/Catamarca");
  15. $tStamp = mktime (17, 17, 17, 1, 7599, 1970);
  16. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  17. $strtotime_tstamp = strtotime("next Sunday", $tStamp);
  18. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  19. print "wanted=Sunday 00:00:00\n\n";
  20. print "TZ=America/Cordoba - wrong day.\n";
  21. date_default_timezone_set("America/Cordoba");
  22. $tStamp = mktime (17, 17, 17, 1, 7599, 1970);
  23. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  24. $strtotime_tstamp = strtotime("next Sunday", $tStamp);
  25. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  26. print "wanted=Sunday 00:00:00\n\n";
  27. print "TZ=America/Rosario - wrong day.\n";
  28. date_default_timezone_set("America/Rosario");
  29. $tStamp = mktime (17, 17, 17, 1, 7958, 1970);
  30. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  31. $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
  32. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  33. print "wanted=Tuesday 00:00:00\n\n";
  34. print "TZ=Europe/Vienna - wrong day - giving unexpected results, at
  35. least on my system :-)\n";
  36. date_default_timezone_set("Europe/Vienna");
  37. $tStamp = mktime (17, 17, 17, 1, 3746, 1970);
  38. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  39. $strtotime_tstamp = strtotime("next Thursday", $tStamp);
  40. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  41. print "wanted=Thursday 00:00:00\n\n";
  42. print "TZ=Asia/Baku - wrong day.\n";
  43. date_default_timezone_set("Asia/Baku");
  44. $tStamp = mktime (17, 17, 17, 1, 8299, 1970);
  45. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  46. $strtotime_tstamp = strtotime("second Monday", $tStamp);
  47. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  48. print "wanted=Monday 00:00:00\n\n";
  49. print "TZ=America/Noronha - wrong day.\n";
  50. date_default_timezone_set("America/Noronha");
  51. $tStamp = mktime (17, 17, 17, 1, 10866, 1970);
  52. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  53. $strtotime_tstamp = strtotime("next Friday", $tStamp);
  54. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  55. print "wanted=Friday 00:00:00\n\n";
  56. print "TZ=America/Havana - wrong day.\n";
  57. date_default_timezone_set("America/Havana");
  58. $tStamp = mktime (17, 17, 17, 1, 12720, 1970);
  59. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  60. $strtotime_tstamp = strtotime("next Thursday", $tStamp);
  61. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  62. print "wanted=Thursday 00:00:00\n\n";
  63. print "TZ=Europe/Tallinn - wrong day.\n";
  64. date_default_timezone_set("Europe/Tallinn");
  65. $tStamp = mktime (17, 17, 17, 1, 11777, 1970);
  66. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  67. $strtotime_tstamp = strtotime("next Saturday", $tStamp);
  68. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  69. print "wanted=Saturday 00:00:00\n\n";
  70. print "TZ=Asia/Jerusalem - wrong day.\n";
  71. date_default_timezone_set("Asia/Jerusalem");
  72. $tStamp = mktime (17, 17, 17, 1, 13056, 1970);
  73. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  74. $strtotime_tstamp = strtotime("next Thursday", $tStamp);
  75. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  76. print "wanted=Thursday 00:00:00\n\n";
  77. print "TZ=Europe/Vilnius - wrong day.\n";
  78. date_default_timezone_set("Europe/Vilnius");
  79. $tStamp = mktime (17, 17, 17, 1, 12140, 1970);
  80. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  81. $strtotime_tstamp = strtotime("next Friday", $tStamp);
  82. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  83. print "wanted=Friday 00:00:00\n\n";
  84. print "TZ=Pacific/Kwajalein - wrong day.\n";
  85. date_default_timezone_set("Pacific/Kwajalein");
  86. $tStamp = mktime (17, 17, 17, 1, 8627, 1970);
  87. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  88. $strtotime_tstamp = strtotime("next Saturday", $tStamp);
  89. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  90. print "wanted=Sunday 00:00:00\n\n";
  91. print "TZ=Asia/Ulan_Bator - wrong day.\n";
  92. date_default_timezone_set("Asia/Ulan_Bator");
  93. $tStamp = mktime (17, 17, 17, 1, 11588, 1970);
  94. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  95. $strtotime_tstamp = strtotime("next Saturday", $tStamp);
  96. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  97. print "wanted=Saturday 00:00:00\n\n";
  98. print "TZ=America/Cancun - wrong day.\n";
  99. date_default_timezone_set("America/Cancun");
  100. $tStamp = mktime (17, 17, 17, 1, 11785, 1970);
  101. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  102. $strtotime_tstamp = strtotime("next Sunday", $tStamp);
  103. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  104. print "wanted=Sunday 00:00:00\n\n";
  105. print "TZ=America/Mexico_City - wrong day.\n";
  106. date_default_timezone_set("America/Mexico_City");
  107. $tStamp = mktime (17, 17, 17, 1, 11781, 1970);
  108. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  109. $strtotime_tstamp = strtotime("next Wednesday", $tStamp);
  110. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  111. print "wanted=Wednesday 00:00:00\n\n";
  112. print "TZ=America/Mazatlan - wrong day.\n";
  113. date_default_timezone_set("America/Mazatlan");
  114. $tStamp = mktime (17, 17, 17, 1, 11780, 1970);
  115. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  116. $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
  117. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  118. print "wanted=Tuesday 00:00:00\n\n";
  119. print "TZ=America/Chihuahua - wrong day.\n";
  120. date_default_timezone_set("America/Chihuahua");
  121. $tStamp = mktime (17, 17, 17, 1, 11782, 1970);
  122. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  123. $strtotime_tstamp = strtotime("next Thursday", $tStamp);
  124. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  125. print "wanted=Thursday 00:00:00\n\n";
  126. print "TZ=Asia/Kuala_Lumpur - wrong day.\n";
  127. date_default_timezone_set("Asia/Kuala_Lumpur");
  128. $tStamp = mktime (17, 17, 17, 1, 4380, 1970);
  129. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  130. $strtotime_tstamp = strtotime("next Monday", $tStamp);
  131. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  132. print "wanted=Monday 00:00:00\n\n";
  133. print "TZ=Pacific/Chatham - wrong day.\n";
  134. date_default_timezone_set("Pacific/Chatham");
  135. $tStamp = mktime (17, 17, 17, 1, 1762, 1970);
  136. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  137. $strtotime_tstamp = strtotime("next Monday", $tStamp);
  138. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  139. print "wanted=Monday 00:00:00\n\n";
  140. print "TZ=America/Lima - wrong day.\n";
  141. date_default_timezone_set("America/Lima");
  142. $tStamp = mktime (17, 17, 17, 1, 5839, 1970);
  143. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  144. $strtotime_tstamp = strtotime("next Thursday", $tStamp);
  145. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  146. print "wanted=Thursday 00:00:00\n\n";
  147. print "TZ=Asia/Karachi - wrong day.\n";
  148. date_default_timezone_set("Asia/Karachi");
  149. $tStamp = mktime (17, 17, 17, 1, 11783, 1970);
  150. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  151. $strtotime_tstamp = strtotime("next Friday", $tStamp);
  152. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  153. print "wanted=Friday 00:00:00\n\n";
  154. print "TZ=America/Asuncion - wrong day.\n";
  155. date_default_timezone_set("America/Asuncion");
  156. $tStamp = mktime (17, 17, 17, 1, 11746, 1970);
  157. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  158. $strtotime_tstamp = strtotime("next Wednesday", $tStamp);
  159. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  160. print "wanted=Wednesday 00:00:00\n\n";
  161. print "TZ=Asia/Singapore - wrong day.\n";
  162. date_default_timezone_set("Asia/Singapore");
  163. $tStamp = mktime (17, 17, 17, 1, 4383, 1970);
  164. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  165. $strtotime_tstamp = strtotime("next Thursday", $tStamp);
  166. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  167. print "wanted=Thursday 00:00:00\n\n";
  168. print "TZ=America/Montevideo - wrong day.\n";
  169. date_default_timezone_set("America/Montevideo");
  170. $tStamp = mktime (17, 17, 17, 1, 12678, 1970);
  171. print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
  172. $strtotime_tstamp = strtotime("next Thursday", $tStamp);
  173. print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
  174. print "wanted=Thursday 00:00:00\n\n";
  175. ?>
  176. --EXPECT--
  177. TZ=America/Mendoza - wrong day.
  178. tStamp=Sunday 1992-10-18 17:17:17 -02 1
  179. result=Sunday 1992-10-25 00:00:00 -02 1
  180. wanted=Sunday 00:00:00
  181. TZ=America/Catamarca - wrong day.
  182. tStamp=Sunday 1990-10-21 17:17:17 -02 1
  183. result=Sunday 1990-10-28 00:00:00 -02 1
  184. wanted=Sunday 00:00:00
  185. TZ=America/Cordoba - wrong day.
  186. tStamp=Sunday 1990-10-21 17:17:17 -02 1
  187. result=Sunday 1990-10-28 00:00:00 -02 1
  188. wanted=Sunday 00:00:00
  189. TZ=America/Rosario - wrong day.
  190. tStamp=Tuesday 1991-10-15 17:17:17 -04 0
  191. result=Tuesday 1991-10-22 00:00:00 -02 1
  192. wanted=Tuesday 00:00:00
  193. TZ=Europe/Vienna - wrong day - giving unexpected results, at
  194. least on my system :-)
  195. tStamp=Thursday 1980-04-03 17:17:17 CET 0
  196. result=Thursday 1980-04-10 00:00:00 CEST 1
  197. wanted=Thursday 00:00:00
  198. TZ=Asia/Baku - wrong day.
  199. tStamp=Sunday 1992-09-20 17:17:17 +04 1
  200. result=Monday 1992-09-28 00:00:00 +04 0
  201. wanted=Monday 00:00:00
  202. TZ=America/Noronha - wrong day.
  203. tStamp=Friday 1999-10-01 17:17:17 -02 0
  204. result=Friday 1999-10-08 00:00:00 -01 1
  205. wanted=Friday 00:00:00
  206. TZ=America/Havana - wrong day.
  207. tStamp=Thursday 2004-10-28 17:17:17 CDT 1
  208. result=Thursday 2004-11-04 00:00:00 CDT 1
  209. wanted=Thursday 00:00:00
  210. TZ=Europe/Tallinn - wrong day.
  211. tStamp=Saturday 2002-03-30 17:17:17 EET 0
  212. result=Saturday 2002-04-06 00:00:00 EEST 1
  213. wanted=Saturday 00:00:00
  214. TZ=Asia/Jerusalem - wrong day.
  215. tStamp=Thursday 2005-09-29 17:17:17 IDT 1
  216. result=Thursday 2005-10-06 00:00:00 IDT 1
  217. wanted=Thursday 00:00:00
  218. TZ=Europe/Vilnius - wrong day.
  219. tStamp=Friday 2003-03-28 17:17:17 EET 0
  220. result=Friday 2003-04-04 00:00:00 EEST 1
  221. wanted=Friday 00:00:00
  222. TZ=Pacific/Kwajalein - wrong day.
  223. tStamp=Saturday 1993-08-14 17:17:17 -12 0
  224. result=Sunday 1993-08-22 00:00:00 +12 0
  225. wanted=Sunday 00:00:00
  226. TZ=Asia/Ulan_Bator - wrong day.
  227. tStamp=Saturday 2001-09-22 17:17:17 +09 1
  228. result=Saturday 2001-09-29 00:00:00 +09 1
  229. wanted=Saturday 00:00:00
  230. TZ=America/Cancun - wrong day.
  231. tStamp=Sunday 2002-04-07 17:17:17 CDT 1
  232. result=Sunday 2002-04-14 00:00:00 CDT 1
  233. wanted=Sunday 00:00:00
  234. TZ=America/Mexico_City - wrong day.
  235. tStamp=Wednesday 2002-04-03 17:17:17 CST 0
  236. result=Wednesday 2002-04-10 00:00:00 CDT 1
  237. wanted=Wednesday 00:00:00
  238. TZ=America/Mazatlan - wrong day.
  239. tStamp=Tuesday 2002-04-02 17:17:17 MST 0
  240. result=Tuesday 2002-04-09 00:00:00 MDT 1
  241. wanted=Tuesday 00:00:00
  242. TZ=America/Chihuahua - wrong day.
  243. tStamp=Thursday 2002-04-04 17:17:17 MST 0
  244. result=Thursday 2002-04-11 00:00:00 MDT 1
  245. wanted=Thursday 00:00:00
  246. TZ=Asia/Kuala_Lumpur - wrong day.
  247. tStamp=Monday 1981-12-28 17:17:17 +0730 0
  248. result=Monday 1982-01-04 00:00:00 +08 0
  249. wanted=Monday 00:00:00
  250. TZ=Pacific/Chatham - wrong day.
  251. tStamp=Monday 1974-10-28 17:17:17 +1245 0
  252. result=Monday 1974-11-04 00:00:00 +1345 1
  253. wanted=Monday 00:00:00
  254. TZ=America/Lima - wrong day.
  255. tStamp=Thursday 1985-12-26 17:17:17 -05 0
  256. result=Thursday 1986-01-02 00:00:00 -04 1
  257. wanted=Thursday 00:00:00
  258. TZ=Asia/Karachi - wrong day.
  259. tStamp=Friday 2002-04-05 17:17:17 PKT 0
  260. result=Friday 2002-04-12 00:00:00 PKST 1
  261. wanted=Friday 00:00:00
  262. TZ=America/Asuncion - wrong day.
  263. tStamp=Wednesday 2002-02-27 17:17:17 -03 1
  264. result=Wednesday 2002-03-06 00:00:00 -03 1
  265. wanted=Wednesday 00:00:00
  266. TZ=Asia/Singapore - wrong day.
  267. tStamp=Thursday 1981-12-31 17:17:17 +0730 0
  268. result=Thursday 1982-01-07 00:00:00 +08 0
  269. wanted=Thursday 00:00:00
  270. TZ=America/Montevideo - wrong day.
  271. tStamp=Thursday 2004-09-16 17:17:17 -03 0
  272. result=Thursday 2004-09-23 00:00:00 -02 1
  273. wanted=Thursday 00:00:00