Why Carbon toDatetimeString is not returning the expected format?

Viewed 9136

From the documentation I see:

 echo $dt->toDateTimeString();                      // 1975-12-25 14:15:16

But Actually if I dump my execution I get:

$now = Carbon::now()->toDayDateTimeString();
dump($now); //Mon, Oct 2, 2017 12:49 PM

I need to :

$now = Carbon::now()->format('Y-m-d H:i:s');

in order to get :

dump($now); //2017-10-02 12:49:06

What am I missing?

1 Answers
Related