I tried
update(['access' => Carbon::now()->format('Y/m/d H:i:s')]);
it returned Y-m-d H:i:s
You can always use Carbon's ->format('m/d/Y'); to change format. Or you can just use selectRaw to build your queries. Save this answer.
So, let's add these variables to config/app. return [ 'date_format' => 'm/d/Y', 'date_format_javascript' => 'MM/DD/YYYY', ]; And then, in Laravel, we can use this: Carbon::createFromFormat(config('app. date_format'), $value)->format('Y-m-d'); Carbon::parse($value)->format(config('app.
now()->format('Y-m-d H:i:s')
You Can Format like above code simply.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With