Home > Blockchain >  I need to generate a good date and time based on laravel carbon, but I need to remove the timezone f
I need to generate a good date and time based on laravel carbon, but I need to remove the timezone f

Time:09-12

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

CodePudding user response:

You can try this :

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