Jump to content

PHP 8.3 error on $modified_date->modify($modifier);


Recommended Posts

Posted

On Services when you select a service (or more) and on lower right, select Invoice Renewal, number of cycles 1, Sumbit.
A php error is generated:

[2025-04-23T20:01:05.131718+00:00] general.ERROR: DateMalformedStringException: DateTime::modify(): Failed to parse time string (+0 onetime) at position 9 (e): Double timezone specification in <omitted>/vendors/minphp/date/src/Date.php:140 Stack trace: #0 <omitted>/vendors/minphp/date/src/Date.php(140): DateTime->modify() #1 <omitted>/app/models/invoices.php(1857): Minphp\Date\Date->modify() #2 <omitted>/app/controllers/admin_clients.php(562): Invoices->createRenewalFromService() #3 <omitted>/app/controllers/admin_clients.php(318): AdminClients->updateServices() #4 <omitted>/vendors/minphp/bridge/src/Lib/Dispatcher.php(142): AdminClients->services() #5 <omitted>/index.php(21): Dispatcher::dispatch() #6 {main}

 

Line 140 of <omitted>/vendors/minphp/date/src/Date.php is:

$modified_date->modify($modifier);

 

According PHP 8.3 specs (https://www.php.net/manual/en/datetime.modify.php):

DateTime::modify() now throws DateMalformedStringException if an invalid string is passed. Previously, it returned false, and a warning was emitted. date_modify() has not been changed.

 

Relevant PHP settings:

cat /usr/local/php83/lib/php.ini | grep timezone
; Defines the default timezone used by the date functions
; https://php.net/date.timezone
date.timezone = "UTC"

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...