Level 2
i suggest you to try like
$string = '2018-09-09 16:34:00';
$date = Carbon::createFromFormat('Y-m-d H:i:s', $string, 'US/..');
$date->setTimezone('UTC');
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a string
$string = "180711000000GMT+0800"
// try to convert it
Carbon::createFromFormat('YmdHisTO', $string)->format...
It shows me this error.
Unexpected data found.
The timezone could not be found in the database
Data missing
How can i convert the datetime if there's GMT+0800 behind of the string?
Please or to participate in this conversation.