So the originally modified date with 5 weeks added is:DateTime Object
(
[date] => 2019-05-06 00:00:00.000000
[timezone_type] => 3
[timezone] => Europe/London
)
1. positive DIFF and addition
diff is: + 1m 5d; days: 35
DateTime Object
(
[date] => 2019-05-06 00:00:00.000000
[timezone_type] => 3
[timezone] => Europe/London
)
is it equal to $date4? bool(true)
2. negative DIFF and addition
diff is: - 1m 5d; days 35DateTime Object
(
[date] => 2019-05-06 00:00:00.000000
[timezone_type] => 3
[timezone] => Europe/London
)
is it equal to $date4? bool(true)
So in order to make it equal to $date4 I need to subtract a negative interval instead of adding a positive one? How crazy is that?!
So the originally modified date with 5 weeks added is:DateTime Object
(
[date] => 2019-05-06 00:00:00.000000
[timezone_type] => 3
[timezone] => Europe/London
)
1. positive DIFF and addition
diff is: + 1m 4d; days: 35
DateTime Object
(
[date] => 2019-05-05 00:00:00.000000
[timezone_type] => 3
[timezone] => Europe/London
)
is it equal to $date4? bool(false)
2. negative DIFF and addition
diff is: - 1m 5d; days 35DateTime Object
(
[date] => 2019-05-06 00:00:00.000000
[timezone_type] => 3
[timezone] => Europe/London
)
is it equal to $date4? bool(true)
So in order to make it equal to $date4 I need to subtract a negative interval instead of adding a positive one? How crazy is that?!
So the originally modified date with 5 weeks added is:DateTime Object
(
[date] => 2019-05-06 00:00:00
[timezone_type] => 3
[timezone] => Europe/London
)
1. positive DIFF and addition
diff is: + 1m 4d; days: 35
DateTime Object
(
[date] => 2019-05-05 00:00:00
[timezone_type] => 3
[timezone] => Europe/London
)
is it equal to $date4? bool(false)
2. negative DIFF and addition
diff is: - 1m 5d; days 35DateTime Object
(
[date] => 2019-05-06 00:00:00
[timezone_type] => 3
[timezone] => Europe/London
)
is it equal to $date4? bool(true)
So in order to make it equal to $date4 I need to subtract a negative interval instead of adding a positive one? How crazy is that?!
Output for 5.3.0 - 5.3.2
So the originally modified date with 5 weeks added is:DateTime Object
(
[date] => 2019-05-06 00:00:00
[timezone_type] => 3
[timezone] => Europe/London
)
1. positive DIFF and addition
diff is: + 1m 5d; days: 35
DateTime Object
(
[date] => 2019-05-06 00:00:00
[timezone_type] => 3
[timezone] => Europe/London
)
is it equal to $date4? bool(true)
2. negative DIFF and addition
diff is: - 1m 5d; days 35DateTime Object
(
[date] => 2019-05-06 00:00:00
[timezone_type] => 3
[timezone] => Europe/London
)
is it equal to $date4? bool(false)
So in order to make it equal to $date4 I need to subtract a negative interval instead of adding a positive one? How crazy is that?!
Output for 5.2.10 - 5.2.17
Fatal error: Call to undefined method DateTime::createFromFormat() in /in/2MNE3 on line 5
Process exited with code 255.
Output for 5.2.0 - 5.2.9
Fatal error: Call to undefined method DateTime::createfromformat() in /in/2MNE3 on line 5
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/2MNE3 on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/2MNE3 on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_VARIABLE in /in/2MNE3 on line 6
Process exited with code 255.