Home > Backend Development > PHP Tutorial > 菜鸟请问日期显示有关问题

菜鸟请问日期显示有关问题

WBOY
Release: 2016-06-13 12:22:36
Original
1035 people have browsed it

初学者请教日期显示问题
我是用PHP+SQL SERVER2005处理datetime字段出现问题。
举例说明下:
数据库里字段名issue_date 字段类型datetime
我用$short=date("Y-m-d",strtotime($rs["issue_date"]));echo $short;显示却是1970-01-01;
strtotime($rs["issue_date"]);显示为空;
直接echo $rs["issue_date"],读取数据库显示为08 7 2014 1:08PM.
说明是数据库读取出的日期格式不对,请问这个问题怎么处理,想显示短日期格式。谢谢

------解决思路----------------------
可以直接用mssql语句吧类型datetime变成日期啊
------解决思路----------------------
查询时 convert(char, 你的日期字段 ,120)

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template