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

afoysal's avatar

Display Date in input type date field

I am fetching date from Database and Displaying in a input type date field. My code is like below

    <input min="2000-01-01" max="2019-12-31" name="date_of_birth" id="dob" type="date" class="form-control" placeholder="Date of birth" value="{{ date('m/d/Y',strtotime($user->date_of_birth)) }}"/>

But I can't see date in input field.

enter image description here

0 likes
5 replies
MattFowles's avatar

if you put the '{{ date('m/d/Y',strtotime($user->date_of_birth)) }}' inside of the placeholder does that work?

2 likes
itsfg's avatar

Hi @afoysal

Maybe it's because of the format ? You're using 'm/d/Y', try 'Y-m-d' ?

1 like
badredy's avatar

value="{{\Illuminate\Support\Carbon::parse($quote->date_quote)->format("Y-m-d")}}" type="date you should make sure that the value you write is that format (2023-12-30)

Please or to participate in this conversation.