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
Release: 2023-09-05 21:38:02
forward
1510 people have browsed it

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");
Copy after login

Output

The output is:

2018-28-03T19:12:49
Copy after login

The HTML with timestamp is:

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

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template