Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How does MySQL get the current time and timestamp

Shulou Source: shulou.com Published: 2022-05-31 10:54:19 09月23日 Update

This article mainly introduces MySQL how to obtain the current time and timestamp related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that everyone will have a harvest after reading this MySQL how to obtain the current time and timestamp article, let's take a look at it.

1, get the current date + time (date + time) function: now()

MySQL> select now();+-------+| now() |+-------+| 2013-04-08 20:56:19 |+-------+

In addition to the now() function, which can get the current date and time, MySQL also has the following functions:

current_timestamp(),current_timestamp,localtime(),localtime,localtimestamp() - (v4.0.6)MySQL timestamp function

MySQL gets the current timestamp function: current_timestamp, current_timestamp()

mysql> select current_timestamp, current_timestamp();+--------------+| current_timestamp | current_timestamp() |+--------------+| 2008-08-09 23:22:24 | 2008-08-09 23:22:24 |+-------------- I believe everyone has a certain understanding of "MySQL how to obtain the current time and timestamp" knowledge. If you still want to learn more knowledge, please pay attention to the industry information channel.

Tags: Time function knowledge content date article value easy to operate article easy to understand more read industry information information channel face channel learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia MariaDB Shulou Information Linux vpn