PHP timestamp to HTML5 input type=datetime element


For HTML5 input time, in PHP:

Example

echo date("Y-m-d\TH:i:s");

Output

The output would be:

2018-28-03T19:12:49

HTML with Timestamp would be:

<input type="datetime" value="<?php echo date("Y-m-d\TH:i:s",$timestamp); ?>"/>

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 20-Dec-2019

631 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements