Failed to parse time string (04-14-2019 07:30) at position 0 (0)

Posted 1 month ago by pickab00

My carbon is returning this error

DateTime::__construct(): Failed to parse time string (04-14-2019 07:30) at position 0 (0): Unexpected character

But I do not see any unexpected characters

here is the code

$parsed_date = $date; //this return   04-14-2019
    $parsed_time = $time->time; //this returns   07:30

$parse_reservation_date = Carbon::parse($parsed_date. ' ' .$parsed_time)->format('Y-m-d H:i:s:u');

return $parse_reservation_date ;

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.