Author: Admin 05/15/2022
Language:
PHP
Views: 7
Tags: input datetime-local php html
Here's some code to set the default datetime for an input box with its type set to datetime-local.
Set the datetime format in PHP.
$datetime = date('Y-m-d\TH:i')
Form field input box code.
<input type="datetime-local" value="<?php echo $datetime; ?>"/>