【发布时间】:2011-11-25 10:08:21
【问题描述】:
我正在尝试转换从 Oracle sql 查询中获得的时间戳格式:
19-SEP-11 02.34.51.558459 PM
我需要将它转换成这种格式:dd-mm-YYYY。
$install_date=strtotime($install_date);
$install_date=date("d/m/Y",strtotime($install_date));
但我得到了奇怪的结果......
有什么想法吗?
*** forgot to mention, the field type is TIMESTAMP and not DATETIME
【问题讨论】:
-
请发布您奇怪的结果,这样我们就不必启动 PHP 解释器并自己做。
-
您对所使用的查询有任何控制权吗?理想情况下,您应该在日期字段上执行
TO_CHAR以获得您想要的。 -
它是否也适用于时间戳字段?
标签: php sql oracle date timestamp