Collections:
Presenting a Past Time in Hours, Minutes and Seconds in MySQL
How To Present a Past Time in Hours, Minutes and Seconds in MySQL?
✍: FYIcenter.com
If you want show an article was posted "n hours n minutes and n seconds ago", you can use the TIMEDIFF(NOW(), pastTime) function as shown in the following tutorial exercise:
SELECT TIMEDIFF(NOW(), '2006-07-01 04:09:49') FROM DUAL; 06:42:58 SELECT TIME_FORMAT(TIMEDIFF(NOW(), '2006-06-30 04:09:49'), '%H hours, %i minutes and %s seconds ago.') FROM DUAL; 30 hours, 45 minutes and 22 seconds ago.
⇒ Extract Unit Values from a Date and Time in MySQL
⇐ Calculating the Difference between Two Time Values in MySQL
2017-12-26, 4374🔥, 0💬
Popular Posts:
How To Connect ASP Pages to Oracle Servers in Oracle? If you are running Windows IIS Web server and ...
How To Use GO Command in "sqlcmd" in SQL Server? "sqlcmd" is a command line client application to ru...
What Happens If the UPDATE Subquery Returns Multiple Rows in MySQL? If a subquery is used in a UPDAT...
What are DDL (Data Definition Language) statements for tables in SQL Server? DDL (Data Definition La...
How To Update Multiple Rows with One UPDATE Statement in SQL Server? If the WHERE clause in an UPDAT...