How to set Tomorrow Date and current time in html input by php

How to set Tomorrow Date and current time in html input by php

Sometimes there is a need to set tomorrow's date and the current time in input. We can do this simply by using the PHP DateTime() Function.

Solution : 

Step1 :  echo (new DateTime('tomorrow'))->format('Y-m-d'); paste this code in html input value like this :
 
<input type="date" value="<?php echo (new DateTime())->format('Y-m-d'); ?>">


Step2 : echo (new DateTime('H:i:s'))->format('H:i:s'); paste this code in html input value like this :
 

<input type="date" value="<?php echo (new DateTime())->format('Y-m-d'); ?>">


I hope this code will help you enjoy coding