Home  >  Article  >  Backend Development  >  请问用什么方法在记录时间的时候记录完整信息,但只输出小时,分,秒信息

请问用什么方法在记录时间的时候记录完整信息,但只输出小时,分,秒信息

WBOY
WBOYOriginal
2016-06-13 10:35:001027browse

请教用什么方法在记录时间的时候记录完整信息,但只输出小时,分,秒信息
$time = date("Y-m-d H:i:s");

这个写入数据库,是完整的时间信息

请教,从数据库查询出之后,用什么方式,只输出小时,分,秒的信息

------解决方案--------------------
date('H:i:s',strtotime($time));

------解决方案--------------------
数据库中的字段类型是什么?

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