Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ctwx's avatar
Level 1

How to change the default date format?

Hello,

I have a different form for adding and editing users, since I cannot use the same date format on my edit form.

My date format is 'd.m.Y', so I use this in my edit form:

{!! Form::input('text', 'birthday', $user->birthday->format('d.m.Y'), ['class' => 'form-control']) !!}

But on my create form I don't need it. My intention was to extract the form into a partial so I can minimize code duplications. When I use "null" as 3. parameter to Form::input() it'll print the right date but in a wrong format.

Is there any way to change the overall date format or any other way to solve my problem easily?

Thanks!

0 likes
2 replies

Please or to participate in this conversation.