Level 10
try this:
$times = array_map(function($date){
// Each element in the array should be carbon object
return $date->toTimeString();
}, $yourArray)
2 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
How to add times array in a format
['01:30:00', '00:10:00', 01:10:00] using laravel carbon
try this:
$times = array_map(function($date){
// Each element in the array should be carbon object
return $date->toTimeString();
}, $yourArray)
Please or to participate in this conversation.