MySQL Date/Time time_format() Function

The time_format() is a MySQL date/time function. It is used to format the time in specified given format_mask.

Syntax

Parameter:

Time: time to be format

Format_mask: format to be applied on time following are the list of options

VALUEDESCRIPTION
%fMicroseconds (000000 to 999999)
%f is available starting in MySQL 4.1.1
%HHour (00 to 23 generally, but can be higher)
%hHour (00 to 12)
%IHour (00 to 12)
%iMinutes (00 to 59)
%pAM or PM
%rTime in 12 hour AM or PM format (hh:mm:ss AM/PM)
%SSeconds (00 to 59)
%sSeconds (00 to 59)
%TTime in 24 hour format (hh:mm:ss)

Example 1

MySQL Datetime time_format() Function
Next TopicMySQL datetime




Latest Courses