Hi Everyone,
I'm having an issue since 2 days and im researching to find a solution for this.
The problem is, I'm reading Mysql timestamps and laravel converting those stamps to carbon instance by default. But when it runs Carbon::createFromFormat($this->getDateFormat(), $value) this function and if the time in timestamp is higher than 12 (e.g 16:00:00) then it drops with error message saying "Failed to parse time string (2017-09-25 16:50 PM) at position 17 (P): The timezone could not be found in the database" ... Any help will be highly appreciated.
If $this->getDateFormat() returns a format using the lowercaseh for hours, then Carbon is not expecting 24 hour times - you need to use the 24 hour formatter H when parsing the datetime from the database.
But your datetime string 2017-09-25 16:50 PM is not in that format - so you are telling it to use a particular format (Y-m-d H:i:s) to parse the string, but then you are not giving a datetime string in the same format. How can this be expected to work?