<?php
//echo date('-m-d', strtotime('+ 15 days'));
$d = new DateTime('2017-01-19');
$d->modify('fifteenth day of this month');
//cho date("Y-m-d",$d);
echo print_r($d,1);
Fatal error: Uncaught DateMalformedStringException: DateTime::modify(): Failed to parse time string (fifteenth day of this month) at position 0 (f): The timezone could not be found in the database in /in/FVKlU:5
Stack trace:
#0 /in/FVKlU(5): DateTime->modify('fifteenth day o...')
#1 {main}
thrown in /in/FVKlU on line 5
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Fatal error: Uncaught DateMalformedStringException: DateTime::modify(): Failed to parse time string (fifteenth day of this month) at position 0 (f): The timezone could not be found in the database in /in/FVKlU:5
Stack trace:
#0 /in/FVKlU(5): DateTime->modify('fifteenth day o...')
#1 {main}
thrown in /in/FVKlU on line 5
Process exited with code 255.
Warning: DateTime::modify(): Failed to parse time string (fifteenth day of this month) at position 0 (f): The timezone could not be found in the database in /in/FVKlU on line 5
DateTime Object
(
[date] => 2017-01-19 00:00:00.000000
[timezone_type] => 3
[timezone] => Europe/Amsterdam
)
Output for 7.3.32 - 7.3.33, 8.0.13
Warning: DateTime::modify(): Failed to parse time string (fifteenth day of this month) at position 0 (f): The timezone could not be found in the database in /in/FVKlU on line 5
DateTime Object
(
[date] => 2017-01-19 00:00:00.000000
[timezone_type] => 3
[timezone] => UTC
)