"/>"/> "/>">

Home >Backend Development >PHP Tutorial >Convert PHP timestamp to element with input type datetime in HTML5

Convert PHP timestamp to element with input type datetime in HTML5

WBOY
WBOYforward
2023-09-05 21:37:061511browse

Convert PHP timestamp to element with input type datetime in HTML5

For HTML5 input time, in PHP:

Example

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

Output

The output is:

2018-28-03T19:12:49

The HTML with timestamp is:

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

The above is the detailed content of Convert PHP timestamp to element with input type datetime in HTML5. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete