Home > php教程 > php手册 > 在php MYSQL中插入当前时间

在php MYSQL中插入当前时间

WBOY
Release: 2016-06-13 12:29:19
Original
994 people have browsed it

NOW()函数以`'YYYY-MM-DD HH:MM:SS'返回当前的日期时间,可以直接存到DATETIME字段中。

CURDATE()以'YYYY-MM-DD'的格式返回今天的日期,可以直接存到DATE字段中。

CURTIME()以'HH:MM:SS'的格式返回当前的时间,可以直接存到TIME字段中。

例:insert into tablename (fieldname) values (now()) 

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template