Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the use of from_unixtime function in MySQL

Shulou Source: shulou.com Published: 2022-06-01 02:42:27 09月22日 Update

This article will explain in detail what is the use of the from_unixtime function in MySQL. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

From_unixtime (timestamp, format):

Timestamp is int time. For example, 14290450779 format is the converted format, which includes the following format:

% M month name (January... December)

% W week name (Sunday... Saturday)

% D the date of the month with the English prefix (1st, 2nd, 3rd, etc.). )

% Y year, number, 4 digits

% y year, number, 2 digits

% an abbreviated name of the week (Sun... Sat)

Number of days in% d month, number (00. 31)

Number of days in% e month, number (0... 31)

% m month, number (01... 12)

% c month, number (1 …... 12)

% b abbreviated month name (Jan... Dec)

% j days of the year (001... 366)

% H hours (00. 23)

% k hours (0. 23)

% h hours (01 …... 12)

% I hours (01 …... 12)

% l hours (1 …... 12)

% I minutes, number (00. 59)

% r time, 12 hours (hh:mm:ss [AP] M)

% T time, 24 hours (hh:mm:ss)

% s seconds (00. 59)

% s seconds (00. 59)

% p AM or PM

% w days in a week (0=Sunday... 6=Saturday)

% U week (0 …... Here Sunday is the first day of the week

% u weeks (0. 52), here Monday is the first day of the week

This is the end of this article on "what is the use of the from_unixtime function in MySQL". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Tags: Week hour number name days month time article function more format abbreviation good practical content prefix article date knowledge one level Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Huawei Linux MySQL OPPO Reno