ta.*_*.is 40
精细的手册有关于NOW功能的说法:
mysql> SELECT NOW();
-> '2007-12-15 23:50:26'
Run Code Online (Sandbox Code Playgroud)
如果您只想要日期,那么请使用CURDATE.精细的手册有关于CURDATE功能的说法:
mysql> SELECT CURDATE();
-> '2008-06-13'
Run Code Online (Sandbox Code Playgroud)
MySQL日期函数下表列出了MySQL中最重要的内置日期函数:
Function Description
NOW() Returns the current date and time
CURDATE() Returns the current date
CURTIME() Returns the current time
DATE() Extracts the date part of a date or date/time expression
EXTRACT() Returns a single part of a date/time
DATE_ADD() Adds a specified time interval to a date
DATE_SUB() Subtracts a specified time interval from a date
DATEDIFF() Returns the number of days between two dates
DATE_FORMAT() Displays date/time data in different formats
Run Code Online (Sandbox Code Playgroud)
可能会使用完整
SQL日期数据类型MySQL带有以下数据类型,用于在数据库中存储日期或日期/时间值:
DATE - format YYYY-MM-DD
DATETIME - format: YYYY-MM-DD HH:MM:SS
TIMESTAMP - format: YYYY-MM-DD HH:MM:SS
YEAR - format YYYY or YY
Run Code Online (Sandbox Code Playgroud)
示例查询:
SELECT NOW();
Will Return '2007-12-15 23:50:26'
Run Code Online (Sandbox Code Playgroud)