php mssql 日期出现中文字符的解决方法_PHP教程

WBOY
Release: 2016-07-21 15:47:26
Original
842 people have browsed it

比如:2005-12-23 读出以后页面会显示为:2005 十二月 23 ,这样给程序处理带来很多不便。查找了一些资料发现是php.ini默认了日期处理功能。
解决方法为:
第一个方法:php文档开头定义ini_set(”mssql.datetimeconvert”,”0″);
第二个方法:修改php.ini,找到;mssql.datetimeconvert = On ,去掉前面的分号,修改on为off,重启apache即可

第三个方法:用SQL的 convert()函数转换,如:
SELECT id, title, convert(char(10),news_time,102) as publish_time, content FROM news

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/319935.htmlTechArticle比如:2005-12-23 读出以后页面会显示为:2005 十二月 23 ,这样给程序处理带来很多不便。查找了一些资料发现是php.ini默认了日期处理功能。 解...
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!