In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Mysql in which time functions, many novices are not very clear, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
Get the current date + time (date + time) function: now (), sysdate ()
The differences are as follows:
MySQL gets the current time functions: current_timestamp, current_timestamp (), current_time, current_time (), current_date, current_date ()
As follows:
MySQL date / time conversion to string functions: date_format (date,format), time_format (time,format)
As follows:
Change varchar type to date type in mysql: str_to_date (str, format)
As follows:
MySQL date / day conversion function: to_days (date), from_days (days)
As follows:
MySQL (time, second) conversion function: time_to_sec (time), sec_to_time (seconds)
As follows:
MySQL adds a time interval to the date: date_add ()
As follows:
MySQL subtracts a time interval from the date: date_sub ()
As follows:
MySQL date and time subtraction function: datediff (date1,date2), timediff (time1,time2). Note: the two parameter types of the timediff (time1,time2) function must be the same.
As follows:
MySQL timestamp (timestamp) conversion, increment and subtraction functions: timestamp (date), timestamp (dt,time), timestampadd (unit,interval,datetime_expr), timestampdiff (unit,datetime_expr1,datetime_expr2)
As follows:
The MySQL timestampdiff () function is more powerful than datediff (), and datediff () can only calculate the number of days between two dates (date).
MySQL time zone (timezone) conversion function: convert_tz (dt,from_tz,to_tz)
Time zone conversion can also be achieved through date_add, date_sub, and timestampadd.
As follows:
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.