80
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
VALUE | DESCRIPTION |
---|---|
%f | Microseconds (000000 to 999999) %f is available starting in MySQL 4.1.1 |
%H | Hour (00 to 23 generally, but can be higher) |
%h | Hour (00 to 12) |
%I | Hour (00 to 12) |
%i | Minutes (00 to 59) |
%p | AM or PM |
%r | Time in 12 hour AM or PM format (hh:mm:ss AM/PM) |
%S | Seconds (00 to 59) |
%s | Seconds (00 to 59) |
%T | Time in 24 hour format (hh:mm:ss) |
Example 1
Next TopicMySQL datetime