MySQL curdate () function instance details, mysqlcurdate
Functions of MySQL CURDATE
If the string context or YYYMMDD format is used in the numeric context, the CURDATE () function returns the current date as a value in YYYY-MM-DD format.
The
Now,curdate,curtime,sysdate differences in MySQL1.now returns the time, in the following format: 2013-01-17 10:57:13Mysql> Select Now (), Sleep (5), now ();+---------------------+----------+---------------------+| Now () | Sleep (5) | Now () |+------
[MySQL] converts the datetime format to bitsCN.com.
[MySQL] converts the datetime format
Here is an example of using the date function. The following query selects all records. The value of date_col is within the last 30 days: www.bitsCN.com
Mysql>
Detailed description of mysql to obtain the current date and format, detailed description of mysql current date
MySQL obtains the current date and Date Format
Get system date: NOW ()
Format date: DATE_FORMAT (date, format)
Note: date: Time
For the description of the valid format of the value range of each type and the specified date and time value, see 7.3.6 Date and Time type.
For the description of the valid format of the value range of each type and the specified date and time
MySQL queries a lot of ways, the following for you to introduce the MySQL query is to query this week, last week, this month, the last month's data, if you are interested in MySQL query, may wish to see.Query the current data todaySELECT
MYSQL gets the current date and date formatGet system Date: Now ()Formatted Date: date_format (date, format)Note: Date: Time fieldFormat: Date formatsReturns the system date, output 2009-12-25 14:38:59Select Now ();Output 09-12-25Select Date_format (
MYSQL gets the current date and date formatGet system Date: Now ()Formatted Date: date_format (date, format)Note: Date: Time fieldFormat: Date formatsReturns the system date, output 2009-12-25 14:38:59Select Now ();Output 09-12-25Select Date_format (
Conversion of the specified format of the millisecond value and date in MySQL and its time function bitsCN.com I. conversion of the millisecond value to the specified date format
Use the FROM_UNIXTIME (unix_timestamp, format) function provided by
Here is an example of using a date function. The following query selects all records and its date_col value is within the last 30 days:
Mysql> SELECT something from table
WHERE To_days (now ())-To_days (Date_col)
DayOfWeek (date)
Returns the week
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.