mysql timestamp conversion/formatting Notice: A non well formed numeric value encountered(mysql时间戳转换/格式化注意:遇到格式不正确的数值)
本文介绍了mysql时间戳转换/格式化注意:遇到格式不正确的数值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的数据库中,我已将已发布"行设置为时间戳,但在尝试对其进行转换/格式化时收到此通知:
In my database I have set row "posted" as a timestamp but I get this notice when trying to convert/format it:
Notice: A non well formed numeric value encountered
代码:
$posted = date('d/m/Y H:i:s', $row['posted']);
echo $posted;
我做错了什么?
推荐答案
这意味着 date()
的第二个参数是整数,所以转换 $row['posted']
先打时间戳.
This means that the second parameter for date()
is expecting integer, so convert $row['posted']
to timestamp first.
试试
$posted = date('d/m/Y H:i:s', strtotime($row['posted']));
这篇关于mysql时间戳转换/格式化注意:遇到格式不正确的数值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
沃梦达教程
本文标题为:mysql时间戳转换/格式化注意:遇到格式不正确的数值


基础教程推荐
猜你喜欢
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 在多维数组中查找最大值 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01