Discover mysql extract date from timestamp, include the articles, news, trends, analysis and practical advice about mysql extract date from timestamp on alibabacloud.com
MySQL obtains the current date and time stamp function bitsCN.com
MySQL returns the current date, time, and timestamp.
1.1 obtain the current date + time (date + time) function: now ()
Mysql> select now ();
+ ------- +
| Now () |
+ ------- +
| 22:2
1.1 Get the current date + time (date + times) function: Now ()Mysql> Select Now (); + ——————— + | Now () | + ——————— + | 2013-04-08 20:56:19 | + ——————— +In addition to the now () function to get the current datetime, MySQL has the following
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
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 TypeMySQL Date Type: Date format, occupied storage space, date range comparison.Date type storage space Date format date range------------ --------- --------------------- -----------------------------------------DateTime 8 bytes
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 timestampdiff () functions are much more powerful than datediff () functions. datediff () can only calculate the number of days for the difference between two dates.
Mysql common date addition and subtraction functions and instance
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
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.