Home >Backend Development >PHP Tutorial >php如何格式化oracle的date类型数据

php如何格式化oracle的date类型数据

WBOY
WBOYOriginal
2016-06-23 13:53:301149browse

小弟初学者,目前用php连上oracle后读取date类型的数据,比如在plsql中查看是 2014-5-24 9:12:13,echo后格式不对,变为24-MAY-14。并且没有时分秒,请问如何才能让它显示为yyyy-MM-dd hh:mm:ss格式呢?


回复讨论(解决方案)

select to_char(sysdate,'yyyy-MM-dd HH24:mi:ss') from dual;//mi是分钟

php读取DB date方法

Statement:
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