HS Banner
Back
HTML Datetime Input Box

Author: Admin 05/15/2022
Language: PHP
Views: 7
Tags: input datetime-local php html


Description:

Here's some code to set the default datetime for an input box with its type set to datetime-local.

Article:

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; ?>"/>


Back
Comments
Add Comment
There are no comments yet.