Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Present a Past Time in Hours, Minutes and Seconds
How To Present a Past Time in Hours, Minutes and Seconds? - MySQL FAQs - Introduction to SQL Date and Time Handling
✍: 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.
2007-05-11, 4870👍, 0💬
Popular Posts:
Write out a function that prints out all the permutations of a string. For example, abc would give y...
How do we host a WCF service in IIS? Note: - The best to know how to host a WCF in IIS is by doing a...
What is the concept of XPOINTER? XPOINTER is used to locate data within XML document. XPOINTER can p...
How To Specify Two Background Images on a Page? - CSS Tutorials - Page Layout and Background Image D...
What is CAR (Causal Analysis and Resolution)? The basic purpose of CAR is to analyze all defects, pr...