I'm running this SELECT
statement:
TIMEDIFF(NOW(), posts.date_modified) as time_ago
And getting results in the format 02:58:32
. The last set of digits, :32
, are the number of seconds.
How can I omit the seconds?
SELECT TIME_FORMAT(TIMEDIFF(NOW(), posts.date_modified), '%H:%i') AS time_ago
Consult the manual for more on TIME_FORMAT()
and a table of allowed specifiers.
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