<?php
date_default_timezone_set("UTC");
echo "works as expected:\n";
echo date("Y-m-d H:i:s", strtotime("2019W14")) . " should be 2019-04-01\n";
echo date("Y-m-d H:i:s", strtotime("2019W15")) . " should be 2019-04-08\n";
echo date("Y-m-d H:i:s", strtotime("2019W16")) . " should be 2019-04-15\n\n";
echo "off by one:\n";
echo date("Y-m-d H:i:s", strtotime("2019W16 next tuesday")) . " should be 2019-04-16\n";
echo date("Y-m-d H:i:s", strtotime("2019W16 next wednesday")) . " should be 2019-04-17\n";
echo date("Y-m-d H:i:s", strtotime("2019W16 next thursday")) . " should be 2019-04-18\n";
echo date("Y-m-d H:i:s", strtotime("2019W16 next friday")) . " should be 2019-04-19\n";
echo date("Y-m-d H:i:s", strtotime("2019W16 next saturday")) . " should be 2019-04-20\n";
echo date("Y-m-d H:i:s", strtotime("2019W16 next sunday")) . " should be 2019-04-21\n";
echo date("Y-m-d H:i:s", strtotime("2019W16 next monday")) . " should be 2019-04-22\n\n";
echo "works as expected:\n";
echo date("Y-m-d H:i:s", strtotime("2019-04-15 next monday")) . " should be 2019-04-22\n";
echo date("Y-m-d H:i:s", strtotime("2019-04-15 next friday")) . " should be 2019-04-19\n";
echo date("Y-m-d H:i:s", strtotime("2019-04-15 next thursday")) . " should be 2019-04-18\n";
works as expected:
2019-04-01 00:00:00 should be 2019-04-01
2019-04-08 00:00:00 should be 2019-04-08
2019-04-15 00:00:00 should be 2019-04-15
off by one:
2019-04-22 00:00:00 should be 2019-04-16
2019-04-16 00:00:00 should be 2019-04-17
2019-04-17 00:00:00 should be 2019-04-18
2019-04-18 00:00:00 should be 2019-04-19
2019-04-19 00:00:00 should be 2019-04-20
2019-04-20 00:00:00 should be 2019-04-21
2019-04-21 00:00:00 should be 2019-04-22
works as expected:
2019-04-22 00:00:00 should be 2019-04-22
2019-04-19 00:00:00 should be 2019-04-19
2019-04-18 00:00:00 should be 2019-04-18
Output for 5.1.0 - 5.1.6
works as expected:
2019-04-01 00:00:00 should be 2019-04-01
2019-04-08 00:00:00 should be 2019-04-08
2019-04-15 00:00:00 should be 2019-04-15
off by one:
2019-04-16 00:00:00 should be 2019-04-16
2019-04-17 00:00:00 should be 2019-04-17
2019-04-18 00:00:00 should be 2019-04-18
2019-04-19 00:00:00 should be 2019-04-19
2019-04-20 00:00:00 should be 2019-04-20
2019-04-21 00:00:00 should be 2019-04-21
2019-04-22 00:00:00 should be 2019-04-22
works as expected:
2019-04-22 00:00:00 should be 2019-04-22
2019-04-19 00:00:00 should be 2019-04-19
2019-04-18 00:00:00 should be 2019-04-18
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/oJ5aQ on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_default_timezone_set() in /in/oJ5aQ on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_set() in /in/oJ5aQ on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_default_timezone_set() in /in/oJ5aQ on line 3