Home  >  Article  >  Database  >  What is the use of from_unixtime function in MySQL

What is the use of from_unixtime function in MySQL

WBOY
WBOYforward
2023-05-31 17:43:121295browse

from_unixtime(timestamp, format):

timestamp is int type time, such as 14290450779; format is the converted format, including the following format:

%M month Name (January...December)
%W Week name (Sunday...Saturday)
%D Day of the month with English prefix (1st, 2nd, 3rd, etc.)
%Y Year, Number, 4 digits
%y Year, number, 2 digits
%a Abbreviated name of the week (Sun...Sat)
%d Number of days in the month, number (00...31)
%e Number of days in the month, number (0...31)
%m Month, number (01...12)
%c Month, number (1...12)
%b Abbreviated month Name (Jan...Dec)
%j Days in the year (001...366)
%H Hours (00...23)
%k Hours (0...23)
%h hour (01……12)
%I hour (01……12)
%l hour (1……12)
%i minute, 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 Number of days in a week (0=Sunday……6=Saturday)
%U Week (0……52), here is Sunday Is the first day of the week
%u week (0......52), here Monday is the first day of the week

The above is the detailed content of What is the use of from_unixtime function in MySQL. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete