HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Format a time
The TIME_FORMAT() function formats a time by a specified format.
TIME_FORMAT(time, format)
Parameter | Description | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
time | Required. The time to be formatted | ||||||||||||||||||||||
format | Required. The format to use. Can be one or a
combination of the following:
|
Works in: | From MySQL 4.0 |
---|
Format a time:
SELECT TIME_FORMAT("19:30:10", "%h %i %s %p");
Format a time:
SELECT TIME_FORMAT("19:30:10", "%r");
Format a time:
SELECT TIME_FORMAT("19:30:10", "%T");