Home » Php » Value of datetime input field can not pass validation

Value of datetime input field can not pass validation

Posted by: admin June 30, 2018 Leave a comment

Questions:

I have this input field for picking date and time

<input type="datetime-local" class="form-control" id="game-date-time-text" name="game_date_time">

And I am trying to format it with below rule

'game_date_time' => 'required|date_format:Y-m-dTH:i'

When I look at the value of this field in my request, an example value looks like this

2001-03-13T13:30

I tried arious types of datetime formats including the one above but my input value can not pass validation. What is the problem here ?

Any help would be appreciated.

Answers: