Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7786533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:25:56+00:00 2026-06-01T20:25:56+00:00

help fix this error Fatal error: Uncaught exception ‘Exception’ with message ‘DateTime::_ construct() [datetime.–construct]:

  • 0

help fix this error

Fatal error: Uncaught exception ‘Exception’ with message ‘DateTime::_construct() [datetime.–construct]: Failed to parse time string (–) at position 0 (-): Unexpected character’ in Z:\home\plati\www\view.php:110 Stack trace: #0 Z:\home\plati\www\view.php(110): DateTime->_construct(‘–‘) #1 {main} thrown in Z:\home\plati\www\view.php on line 110

$newday = $a['dayz'];
$endmonth = $a['monthz'];
$newyear = $a['yearz'];
$date = new DateTime("$newyear-$endmonth-$newday");
$date->modify('+8 day');
$year = $date->format('Y');
$month = $date->format('m');
$day = $date->format('d');
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:25:57+00:00Added an answer on June 1, 2026 at 8:25 pm

    help fix this error

    You can easily deal with the exception by catching it, this will fix the error in the sense that you don’t need to bother about that error any longer:

    try {
        $newday = $a['dayz'];
        $endmonth = $a['monthz'];
        $newyear = $a['yearz'];
        $date = new DateTime("$newyear-$endmonth-$newday");
        $date->modify('+8 day');
        $year = $date->format('Y');
        $month = $date->format('m');
        $day = $date->format('d');
    } catch(Exception $e) {
        # do nothing
    }
    

    At least at some point you need to do error handling. Exceptions require you to do that, DateTime throws exceptions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone help me to fix this error on getPointerCount() , getX() , and
Could you help me fix the menu on this this page ? The menu
I really need some help with this as I have been trying to fix
Please help me to fix the CSS error in profile on my site (IE).
Iam getting the following error , could some one help me how to fix
So I get my logcat spammed by this datarouter error. Anyone who can help
I don't totally understand how all this works, but I'm getting this error: Fatal
Im getting this error but there is no documentation to fix my problem i
Is there a tool to help fix Html errors and warnings? I just checked
Sure it's a simple question, but I can't fix it, can somebody help me?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.