php - I need to generate a good date and time based on laravel carbon, but I need to remove the timezone from this return

Below is my code snippet and given return, Didn't want to remove the last characters as a string

$ini= Carbon::now()->subDays(3)->toAtomString();

return:

"2022-09-09T10:50:27-03:00"

I need:

2022-09-09T10:50:27

Answer

Solution:

You can try this :

Carbon::now()->subDays(3)->format('Y-m-d\TH:i:s');

Source