本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长


+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

暂无数据

如何在输入 datetime-local 中显示日期和时间

发布于2023-03-24 16:22     阅读(523)     评论(0)     点赞(0)     收藏(4)


I have created a table with field date_time and its data type is datetime.

I am fetching records from this table using PHP, and I want to show this date and time in HTML page.

<input type="datetime-local" name="date"/>

I am setting its value attribute, but its not showing the date, Is there any conversion I need to perform to show this date time in input of HTML?


解决方案


需要将mysql的日期值转换为HTML默认的datetime-local格式,使用该函数进行转换。

date ('Y-m-d\TH:i:s', strtotime($Yordatevalue));



所属网站分类: 技术文章 > 问答

作者:黑洞官方问答小能手

链接:http://www.qianduanheidong.com/blog/article/516815/d4dd92183fc8d667fa03/

来源:前端黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

0 0
收藏该文
已收藏

评论内容:(最多支持255个字符)