Is there a better way to format a time field to have a lowercase AM or PM? This is what I have in my SELECT statement and it works but it is rather clunky:
CONCAT_WS('', DATE_FORMAT(time, '%l:%i '), LOWER(DATE_FORMAT(`time`, '%p'))) AS time
I guess more importantly is there any significant overhead associated with formatting using SQL functions like this?
you can directly do it without concactenation.
LOWER(DATE_FORMAT(`time`,'%l:%i %p'))
SEE HERE @ SQLFiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With