Ashutosh Kolambkar
Ashutosh Kolambkar

Reputation: 392

I want to select min date and time in php

My Code:

<input type="datetime-local" class="form-control" id="date" min ='<?php echo date('Y-m-d');?>'max="2099-12-31"  name="InterviewDate" required>

What should appear in min?

Thanks in advance

Upvotes: 0

Views: 2186

Answers (1)

Herbert Scheffknecht
Herbert Scheffknecht

Reputation: 631

You need to specify a time with the date in W3C format (example: "2018-06-07T00:00"). See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local

<input type="datetime-local" class="form-control" id="date" min ='<?php echo date('Y-m-d');?>T00:00'max="2099-12-31T00:00"  name="InterviewDate" required>

Upvotes: 2

Related Questions