Mysql in the current time to take the system, the current date to facilitate the query to determine the code _mysql

Source: Internet
Author: User
Tags mysql in time and date
PHP often through the following code, get the decision date of the SQL query statement
Copy Code code as follows:

$now = time (); Get the date of the current period
$sql = "SELECT * from ' the ' team ' where end_time> $now order by Sort_order limit 0,4";



gets the MySQL time function for the current time

There are a number of functions to handle MySQL time and date, and here is a MySQL time function for getting the current time, if you are interested in it, may wish to see

The MySQL time function, described below, is used to get the current time, and the MySQL time function is highly practical, and hopefully it will help you learn about MySQL time functions.
Copy Code code as follows:

mysql> select Current_timestamp ();
+---------------------+
| current_timestamp () |
+---------------------+
| 2010-01-18 21:24:37 |
+---------------------+
1 row in Set (0.00 sec)

mysql> Select Current_date ();
+----------------+
| current_date () |
+----------------+
| 2010-01-18 |
+----------------+
1 row in Set (0.00 sec)

mysql> Select Current_time ();
+----------------+
| current_time () |
+----------------+
| 21:24:46 |
+----------------+
1 row in Set (0.00 sec)
Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.