Fatal error: Uncaught exception ‘Exception’ with message ‘DateTime::__construct

While editing user details in “User Manager” in Joomla back-end, you may get the following error message.

Fatal error: Uncaught exception \\\’Exception\\\’ with message \\\’DateTime::__construct() [<a href=\\\’datetime.–construct\\\’>datetime.–construct</a>]: Failed to parse time string (24/05/1995) at position 0 (2): Unexpected character\\\’ in /home/cpaneluser/public_html/libraries/joomla/utilities/date.php:149 Stack trace: #0 /home/cpaneluser/public_html/libraries/joomla/utilities/date.php(149): DateTime->__construct(\\\’24/05/1995\\\’, Object(DateTimeZone)) #1 /home/cpaneluser/public_html/libraries/joomla/factory.php(452): JDate->__construct(\\\’24/05/1995\\\’, \\\’UTC\\\’) #2 /home/cpaneluser/public_html/libraries/joomla/html/html.php(573): JFactory::getDate(\\\’24/05/1995\\\’, \\\’UTC\\\’) #3 [internal function]: JHtml::date(\\\’24/05/1995\\\’) #4 /home/cpaneluser/public_html/libraries/joomla/html/html.php(187): call_user_func_array(Array, Array) #5 /home/cpaneluser/public_html/libraries/joomla/html/html.php(87): JHtml::call(Array, Array) #6 /home/cpaneluser/public_html/libraries/joomla/html/html.php(718): JHtml::_(\\\’date\\\’, \\\’24/05/1995\\\’) #7 [internal function]: JHtml::calendar(\\\’24/05/1995 in /home/cpaneluser/public_html/libraries/joomla/utilities/date.php on line 149

This is the error due to wrong date format used while adding/registering a new user.

To correct the issue, check related database name in “configuration.php” >> access PHPmyadmin in WHM >> Select proper database >> Search “24/05/1995” by selecting all the tables and edit related table accordingly and change the value “24/05/1995” to “24-05-1995”.

In most of the cases, the table will be “jos_user_profiles” so you need to edit “profile.dob” for respective user ID for which you are getting the error.

Tagged . Bookmark the permalink.

Leave a Reply