Date and Time functionsThis chapter discusses some functions that can be used to manipulate time values. See section 11.3, "Date and Time type" for valid formats for each time and date type with a range and a specified value.
The following example
MySQL date data type and time type usage summary MySQL date type: Date format, storage space occupied, date range comparison.
Date type storage space date format date range
-----------------------------------------------------------------------------
MySQL date type: Date Format, storage space occupied, and date range comparison.Date type storage space date format date range-----------------------------------------------------------------------------------Datetime 8 bytes YYYY-MM-DD hh: mm: SS 10
Turn from:http://blog.chinaunix.net/space.php?uid=11327712&do=blog&id=32416MySQL Date Type: Date format, occupied storage space, date range comparison.Date type storage space date format date range-----------------------------------------------------
MySQL obtains the bitsCN of the current date and time (and converts the time. com1.1 obtain the current date + time (date + time) function: in addition to the now () function to obtain the current date and time, MySQL also has the following function:
Original link:MySQL time and date function-Redfox-Blog ParkHttp://www.cnblogs.com/redfox241/archive/2009/07/23/1529092.html--------------------------------------------------------------------------------------------------------------- ---------------
First, MySQL gets the current date time function1.1 Get the current date + time (date + times) function: Now ()Mysql> Select Now (); +---------------------+| Now () |+---------------------+| 2015-01-22 22:20:46
1.1 Get the current date + time (date + times) function: Now ()In addition to the now () function to get the current date time, MySQL has the following functionCurrent_timestamp () current_timestampLocalTime () localtimeLocaltimestamp ()
Localtimestamp () LocaltimestampThese date-time functions are equivalent to now (). Since the now () function is short and easy to remember, it is recommended that you always use now () instead of the functions listed above.1.2 Get the current date +
First, MySQL gets the current date time function1.1 Get the current date + time (date + times) function: Now ()Mysql> Select Now ();+---------------------+| Now () |+---------------------+| 2008-08-08 22:20:46 |+---------------------+In addition to
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.