The format in which PHP date() function writes to mysql

巴扎黑
Release: 2016-11-23 10:23:45
Original
2365 people have browsed it

<?php 
echo date("Y-m-d"); 
//显示格式为:XXXX-XX-XX 
//必须使用上面这种格式存入mysql的date字段中 
echo date("Y-m-d H:i:s"); 
//显示格式为:XXXX-XX-XX XX:XX:XX 
//必须使用上面这种格式存入mysql的datetime字段中 
?>
Copy after login


Related labels:
php
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!