Insert the current time in MYSQL, just like GETDATE () of SQLSERVER. (See the previous section)-database-related-P. The NOW () function returns the current DATETIME with 'yyyy-MM-DDHH: MM: SS, which can be saved directly to the DATETIME field. CURDATE () returns today's date in the format of 'yyyy-MM-DD ', which can be saved directly to the NOW () function with ''yyyy-MM-DD HH: MM: SS' returns the current date and time, which can be directly stored in the DATETIME field.
CURDATE () returns today's DATE in 'yyyy-MM-DD 'format and can be saved directly to the DATE field.
CURTIME () returns the current TIME in 'hh: MM: SS' format and can be saved directly to the TIME field.
Example: insert into tablename (fieldname) values (now ())
The http://www.bkjia.com/PHPjc/631441.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/631441.htmlTechArticleNOW () function returns the current DATETIME with ''yyyy-MM-DD HH: MM: ss' and can be saved directly to the DATETIME field. CURDATE () returns today's date in 'yyyy-MM-DD 'format, can be saved directly...