Jump to content

stephenl7

New Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by stephenl7

  1. Hello I am trying to store the date and time from a email header (retrived using imap_fetch_overview) in a MYSql database My current code seems logical, however doesn't work // read datetime from header $datestr = $overview->date; // format $dateTime = DateTime::createFromFormat('D, d M Y H:i:s O', $datestr); $errors = DateTime::getLastErrors(); if (!empty($errors['warnings'])) { echo "Invalid Date\n"; } // convert to mysql format $date = $dateTime->format('Y-m-d H:m:s'); Reported error Fatal error: Call to a member function format() on a non-object in Any advise and suggestions would be appreciated Thank you
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.