Just a little more to clarify things: the CURRENT_TIME function returns a TIME value that has no format. The format is applicable only when passing it to CHARACTER:
DECLARE now12, now24 CHARACTER; SET now12 = CAST (CURRENT_TIME AS CHARACTER FORMAT 'h:mma'); SET now24 = CAST (CURRENT_TIME AS CHARACTER FORMAT 'hh:mm');
See the other answers to find the format string you need.
source share