Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does MySQL get the current time and timestamp

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report