【发布时间】:2017-12-01 07:05:31
【问题描述】:
我的数据库中有一个时间戳列。我需要将时间戳分别转换为日期和时间。
我用
$timestamp = strtotime($row1['timestamp']);
$date = date('d-m-Y', $timestamp);
$time = date('Gi.s', $timestamp);
当我使用此代码时,我没有正确获取时间。 输入:2017-06-06 08:06:14 输出: 日期:06-06-2017 时间:806.14
提前致谢
【问题讨论】:
-
哪个数据库?
标签: python sql date time timestamp