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

AwadGorg's avatar

The specified value does not conform to the required format yyyy-MM-dd

Hello, I have a date input and am setting the value of it using data from the database table here is my code

<input type="date" name="exit_time" id="exit_time"
                                        value="{{ date('Y-m-d', strtotime($book->exit_time)) }}">

for some reason, it shows me the error

The specified value does not conform to the required format yyyy-MM-dd

I've tried echoing out the code

{{ date('Y-m-d', strtotime($book->exit_time)) }}

and this is the returned value

2022-03-19

and it should be a valid date.it's not showing in the input

0 likes
6 replies
Snapey's avatar

what does the html look like in the browser (view source)

AwadGorg's avatar

@Snapey

<input type="date" name="exit_time" id="exit_time"
                                        value="2022-03-19">
                                        

this is how the HTML looks like in the view source

Snapey's avatar
Snapey
Best Answer
Level 122

Is the error in the console from some date picker library?

Do you have more than one date input?

AwadGorg's avatar

@Snapey yes I have 2 date inputs on my page, I Am also using a Date range picker

AwadGorg's avatar

@Snapey well looks like the date range picker library was causing the issue, my input date id has the same id as the id from the daterange

Snapey's avatar

My guess is that you have another field with type="date"

I would search the browser source

Please or to participate in this conversation.